Subscribe on changes!

can't resolve 'vue'

avatar
Jan 26th 2021

Version

3.0.5

Reproduction link

https://github.com/clark-cui/vue3-problem

Steps to reproduce

yarn

npm run dev

What is expected?

devServer work successfully.

What is actually happening?

Module not found: Error: Can't resolve 'vue' in 'F:\workspace_github\vue3-problem'


I didn't use vue-cli or vite to build this reposity.

so I use "vue-loader": "^16.1.2" and "@vue/compiler-sfc": "^3.0.0" to resolve '.vue'.

If i use cdn to import vue.Then it occur error like this.

If i use npm to import vue.This problem is solved.

This hadn't happen in vue2.I guess it's vue-compiler 's falut.

I want to use vue with cdn.How to solve this?

avatar
Jan 26th 2021

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.


You can also use the generated templates from vue-cli and inspect the webpack config to generate your own project but this is a question about configuring webpack with vue. This should help: https://cli.vuejs.org/guide/webpack.html#inspecting-the-project-s-webpack-config