fix: Disabling dev tool make the project crash
đ The bug
When you create a new project with :
npx nuxi@latest init test
then run :
npx nuxi devtools disable
the run the project with : npm run dev
you get this error :
ERROR Internal server error: Failed to resolve import "virtual:vue-inspector-path:Overlay.vue" from "node_modules/vite-plugin-vue-inspector/src/load.js?v=51e81404". Does the file exist? 15:45:51
Plugin: vite:import-analysis
File: /Users/landry/Desktop/test/node_modules/vite-plugin-vue-inspector/src/load.js?v=51e81404:4:18
2 |
3 | import * as Vue from 'vue'
4 | import App from 'virtual:vue-inspector-path:Overlay.vue'
| ^
5 | import inspectorOptions from 'virtual:vue-inspector-options'
6 | const CONTAINER_ID = 'vue-inspector-container'
at formatError (file:///Users/landry/Desktop/test/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:50830:46)
at TransformContext.error (file:///Users/landry/Desktop/test/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:50824:19)
at normalizeUrl (file:///Users/landry/Desktop/test/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:66128:33)
at async file:///Users/landry/Desktop/test/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:66283:47
at async Promise.all (index 1)
at async TransformContext.transform (file:///Users/landry/Desktop/test/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:66204:13)
at async Object.transform (file:///Users/landry/Desktop/test/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:51139:30)
at async loadAndTransform (file:///Users/landry/Desktop/test/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:53894:29)
đ ī¸ To reproduce
https://github.com/Arcelone/devtoolsbug
đ Expected behavior
That the project works properly without the devtools.
âšī¸ Additional context
.nuxtrc contain just this telemetry.enabled=false
version :
- nvm : 0.39.7 (installed with
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash) - node : v20.13.1
- npm : 10.8.0
- Nuxt : 3.11.2
- Nitro 2.9.6
No "system" version of node installed. I have tried with but doesn't solve anything.
If you create the project with :
npx nuxi@latest init content-app -t content
and the disable with :
npx nuxi devtools disable
everything is working well.
nuxt.config.ts
export default defineNuxtConfig({
vite: {
server: {
hmr: {
overlay: false,
},
},
},
})
@Arcelone I just did your reproduction steps and I got no error, worked as expected
This behavior is fix withe 3.12 version release. đđģ
EDIT : obviously present again in subsequent versions.
I'm getting this as well, 3.12.4
Can confirm, I'm getting the same error in 3.12.4.
Can confirm, I'm getting the same error in 3.13.0 also.
ERROR Internal server error: Failed to resolve import "virtual:vue-inspector-path:Overlay.vue" from "../../node_modules/vite-plugin-vue-inspector/src/load.js?v=dc493e27". Does the file exist? 3:58:51 PM
Plugin: vite:import-analysis
File: ./node_modules/vite-plugin-vue-inspector/src/load.js?v=dc493e27:4:18
2 |
3 | import * as Vue from 'vue'
4 | import App from 'virtual:vue-inspector-path:Overlay.vue'
| ^
5 | import inspectorOptions from 'virtual:vue-inspector-options'
6 | const CONTAINER_ID = 'vue-inspector-container'
Get this in latest Chrome but not when using inkognito or in Firefox on a mac.
Still getting this issue with 3.13.2
Same. 3.13.2
Fix with this version :
- Nuxt Version: 3.13.2
- CLI Version: 3.14.0
- Nitro Version: 2.9.7
If any one can confirme ? That I can close the issue.
same! 3.13.2
Same problem
So, on 3.13.2, i managed to get it going again by adding this explicitly on nuxt.config.ts:
devtools: {
enabled: false,
}
also, i read somewhere that nuxt-security might be causing the issue, but I can't confirm. I've got nuxt-security set up, with the headers settings to make devtools work, but if i explicitly disable them with the code above, it doesn't crash.
Problem went away on its own.. not really sure what happened.
Still having this issue
I encounter this error when installing dependencies with bun, but not with pnpm