Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin-vue won't work in yarn workspace with pnp support #5326

Closed
7 tasks done
miaulightouch opened this issue Oct 17, 2021 · 1 comment
Closed
7 tasks done

plugin-vue won't work in yarn workspace with pnp support #5326

miaulightouch opened this issue Oct 17, 2021 · 1 comment

Comments

@miaulightouch
Copy link

Describe the bug

it's not work if move project into workspace, vue plugin seems blind that cannot find vue or compiler-sfc package.

now, I just use pnpm instead, and it works.

Reproduction

  1. clone https://github.com/miaulightouch/vite-issue
  2. yarn
  3. cd packages/simple
  4. yarn dev

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
    Memory: 5.06 GB / 15.92 GB
  Binaries:
    Node: 14.18.0 - ~\scoop\apps\nodejs-lts\current\node.EXE
    Yarn: 3.0.2 - ~\scoop\apps\yarn\current\Yarn\bin\yarn.CMD
    npm: 6.14.15 - ~\scoop\apps\nodejs-lts\current\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (94.0.992.50)
    Internet Explorer: 11.0.19041.1202

Used Package Manager

yarn

Logs

failed to load config from C:\Users\Miau\Documents\PA\vite-issue\packages\simple\vite.config.ts
error when starting dev server:
Error: @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc to be present in the dependency tree.
    at Object.<anonymous> (C:\Users\Miau\Documents\PA\vite-issue\.yarn\__virtual__\@vitejs-plugin-vue-virtual-549d592d48\0\cache\@vitejs-plugin-vue-npm-1.9.3-b28928ee51-b987535135.zip\node_modules\@vitejs\plugin-vue\dist\index.js:4088:11)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.external_module_.Module._load (C:\Users\Miau\Documents\PA\vite-issue\.pnp.cjs:11821:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (C:\Users\Miau\Documents\PA\vite-issue\packages\simple\vite.config.ts:30:36)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.require.extensions.<computed> [as .ts] (C:\Users\Miau\Documents\PA\vite-issue\.yarn\__virtual__\vite-virtual-2a5de8907d\0\cache\vite-npm-2.6.7-13d03f8d6e-cf395366e4.zip\node_modules\vite\dist\node\chunks\dep-713b45e1.js:68644:20)

Validations

@sapphi-red
Copy link
Member

I was able to reproduce it.
After upgrading vite to 2.9.12 and plugin-vue to 2.3.3, it worked.
Closing as it is fixed.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants