devtools
devtools copied to clipboard
Do not use fs injection for bundled dev mode on Vite 8.1+
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.
https://github.com/vitejs/devtools/blob/ced00d41288fbaca34f5b9e26b668e5e880726d7/packages/core/src/node/plugins/injection.ts#L13-L24
It will make Vite devtools stop working after upgrading.
@fs//Users/liangmi/code/liangmiQwQ/simple-introduce/node_modules/.pnpm/@[email protected][email protected][email protected]/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
- [x] Follow our Code of Conduct
- [x] Read the Contributing Guide.
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [x] The provided reproduction is a minimal reproducible of the bug.