vuejs / vue-loader

📦 Webpack loader for Vue.js components
MIT License
4.99k stars 914 forks source link

[Error] cannot find vue/compiler-sfc when using yarn workspace and lerna to install node_modules. #2031

Closed radiorz closed 1 year ago

radiorz commented 1 year ago

depend:

"@vue/compiler-sfc": "^3.2.47",
"vue-loader": "^17.0.1",
 "webpack": "^5.76.1",

Try:

demo :

https://github.com/radiorz/webpack-demo

heywhy commented 1 year ago

I'm also facing this same issue because my project does not need vue to work. while looking at the vue-loader project I found this

https://github.com/vuejs/vue-loader/blob/1b1a195612f885a8dec3f371edf1cb8b35d341e4/src/index.ts#L8

the above is an opposite of

https://github.com/vuejs/vue-loader/blob/1b1a195612f885a8dec3f371edf1cb8b35d341e4/src/compiler.ts#L9-L25

replacingvue/sfc-compiler with ./compiler resolves this issue. I hope it get's fixed soon