nuxt / devtools

Unleash Nuxt Developer Experience
https://devtools.nuxt.com
MIT License
2.78k stars 154 forks source link

fix: Disabling dev tool make the project crash #667

Closed Arcelone closed 2 hours ago

Arcelone commented 1 month ago

šŸ› 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 :

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.

cpninjaru commented 3 weeks ago

nuxt.config.ts

export default defineNuxtConfig({
  vite: {
    server: {
      hmr: {
        overlay: false,
      },
    },
  },
})
arashsheyda commented 1 week ago

@Arcelone I just did your reproduction steps and I got no error, worked as expected

Arcelone commented 2 hours ago

This behavior is fix withe 3.12 version release. šŸ‘šŸ»