devtools-next icon indicating copy to clipboard operation
devtools-next copied to clipboard

Vite plugin not working in Yarn 4 monorepo

Open viell-dev opened this issue 3 months ago • 1 comments

Not sure if this is a problem on your end of some quirk of Yarn.

failed to load config from /home/viell/projects/vite-plugin-bug-repro/packages/web/vite.config.mts
error when starting dev server:
Error: @vue/devtools-core tried to access vue, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: vue (via "vue/package.json")
Required by: @vue/devtools-core@npm:7.2.0 (via /home/viell/.yarn/berry/cache/@vue-devtools-core-npm-7.2.0-6c8d6b484b-10c0.zip/node_modules/@vue/devtools-core/dist/index.js)

    at makeError (/home/viell/projects/vite-plugin-bug-repro/.pnp.cjs:8807:34)
    at resolveToUnqualified (/home/viell/projects/vite-plugin-bug-repro/.pnp.cjs:10455:21)
    at Object.resolveToUnqualified (/home/viell/projects/vite-plugin-bug-repro/.pnp.cjs:10635:26)
    at resolve$1 (file:///home/viell/projects/vite-plugin-bug-repro/.pnp.loader.mjs:2027:31)
    at nextResolve (node:internal/modules/esm/hooks:750:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:238:30)
    at handleMessage (node:internal/modules/esm/worker:199:24)
    at Immediate.checkForMessages (node:internal/modules/esm/worker:141:28)
    at process.processImmediate (node:internal/timers:478:21)

Repro @ https://github.com/viell-dev/vite-plugin-bug-repro

Works fine as a standalone (see standalone branch)

Or if I add vue as a dependency of @vue/devtools-core in .yarnrc.yml (see workaround branch)

Edit: Upgraded to 7.2.0

viell-dev avatar May 15 '24 10:05 viell-dev