devtools icon indicating copy to clipboard operation
devtools copied to clipboard

fix: Disabling dev tool make the project crash

Open Arcelone opened this issue 1 year ago â€ĸ 11 comments

🐛 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.

Arcelone avatar May 19 '24 14:05 Arcelone

nuxt.config.ts

export default defineNuxtConfig({
  vite: {
    server: {
      hmr: {
        overlay: false,
      },
    },
  },
})

cpninjaru avatar Jun 14 '24 09:06 cpninjaru

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

arashsheyda avatar Jun 22 '24 17:06 arashsheyda

This behavior is fix withe 3.12 version release. 👍đŸģ

EDIT : obviously present again in subsequent versions.

Arcelone avatar Jul 06 '24 09:07 Arcelone

I'm getting this as well, 3.12.4

franzwarning avatar Jul 25 '24 22:07 franzwarning

Can confirm, I'm getting the same error in 3.12.4.

BombayV avatar Aug 13 '24 19:08 BombayV

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'

Matrix-aas avatar Aug 26 '24 13:08 Matrix-aas

Get this in latest Chrome but not when using inkognito or in Firefox on a mac.

MikeMichel avatar Sep 14 '24 13:09 MikeMichel

Still getting this issue with 3.13.2

mtzrmzia avatar Sep 25 '24 19:09 mtzrmzia

Same. 3.13.2

pwnkdigital avatar Sep 27 '24 09:09 pwnkdigital

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.

Arcelone avatar Oct 01 '24 10:10 Arcelone

same! 3.13.2

Willadaygo avatar Oct 08 '24 07:10 Willadaygo

Same problem

murshex avatar Oct 09 '24 03:10 murshex

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.

pwnkdigital avatar Oct 09 '24 09:10 pwnkdigital

Problem went away on its own.. not really sure what happened.

murshex avatar Oct 09 '24 09:10 murshex

Still having this issue

Curs3W4ll avatar Nov 27 '24 14:11 Curs3W4ll

I encounter this error when installing dependencies with bun, but not with pnpm

Yiximail avatar Mar 28 '25 18:03 Yiximail