Describe the bug
When enable bundled dev mode in Vite 8.1+ (Also known as full bundle mode), we cannot ask Vite to read files on disk anymore.
At the same time, Vite devtools will inject the scrips to html file with a @fs URL.
|
transformIndexHtml() { |
|
const fileUrl = process.env.VITE_DEVTOOLS_LOCAL_DEV |
|
? normalize(join(dirDist, '..', 'src/client/inject/index.ts')) |
|
: normalize(join(dirDist, 'client/inject.js')) |
|
return [ |
|
{ |
|
tag: 'script', |
|
attrs: { |
|
src: `/@fs/${fileUrl}`, |
|
type: 'module', |
|
}, |
|
injectTo: 'body', |
It will make Vite devtools stop working after upgrading.
@fs//Users/liangmi/code/liangmiQwQ/simple-introduce/node_modules/.pnpm/@vitejs+devtools@0.3.3_typescript@5.9.3_vite@8.1.0/node_modules/@vitejs/devtools/dist/client/inject.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
Reproduction
https://github.com/liang-demos/vite-devtools-bundled-dev-reproduction
System Info
System:
OS: macOS 26.5.1
CPU: (15) arm64 Apple M5 Pro
Memory: 1.07 GB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.12.0 - /Users/liangmi/.vite-plus/js_runtime/node/24.12.0/bin/node
Yarn: 1.22.22 - /Users/liangmi/.vite-plus/bin/yarn
npm: 11.6.2 - /Users/liangmi/.vite-plus/js_runtime/node/24.12.0/bin/npm
pnpm: 11.4.0 - /Users/liangmi/.vite-plus/bin/pnpm
bun: 1.4.0 - /Users/liangmi/.bun/bin/bun
Browsers:
Chrome: 148.0.7778.216
Safari: 26.5
Used Package Manager
npm
Validations
Describe the bug
When enable bundled dev mode in Vite 8.1+ (Also known as
full bundle mode), we cannot ask Vite to read files on disk anymore.At the same time, Vite devtools will inject the scrips to html file with a
@fsURL.devtools/packages/core/src/node/plugins/injection.ts
Lines 13 to 24 in ced00d4
It will make Vite devtools stop working after upgrading.
Reproduction
https://github.com/liang-demos/vite-devtools-bundled-dev-reproduction
System Info
System: OS: macOS 26.5.1 CPU: (15) arm64 Apple M5 Pro Memory: 1.07 GB / 48.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.12.0 - /Users/liangmi/.vite-plus/js_runtime/node/24.12.0/bin/node Yarn: 1.22.22 - /Users/liangmi/.vite-plus/bin/yarn npm: 11.6.2 - /Users/liangmi/.vite-plus/js_runtime/node/24.12.0/bin/npm pnpm: 11.4.0 - /Users/liangmi/.vite-plus/bin/pnpm bun: 1.4.0 - /Users/liangmi/.bun/bin/bun Browsers: Chrome: 148.0.7778.216 Safari: 26.5Used Package Manager
npm
Validations