vue3 报错 Module not found: Error: Can't resolve ?
明明有 src/components/echarts/MetaOverview.vue
但是报错找不到:
ERROR Failed to compile with 1 error 2:53:16 PM error in ./src/components/Demo.vue?vue&type=script&lang=js
Module not found: Error: Can't resolve './components/echarts/MetaOverview.vue' in '/Users/ponponon/Desktop/code/work/ponponon-it/tracking-king/src/components'
ERROR in ./src/components/Demo.vue?vue&type=script&lang=js (./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/Demo.vue?vue&type=script&lang=js) 1:0-65
Module not found: Error: Can't resolve './components/echarts/MetaOverview.vue' in '/Users/ponponon/Desktop/code/work/ponponon-it/tracking-king/src/components'
@ ./src/components/Demo.vue?vue&type=script&lang=js 1:0-196 1:0-196 1:197-382 1:197-382
@ ./src/components/Demo.vue 2:0-55 3:0-50 3:0-50 6:49-55
@ ./src/router/index.js 22:0-41 41:13-17
@ ./src/main.js 3:0-30 11:31-37
webpack compiled with 1 error
回答:
你这个引入的都有问题啊,实在不懂怕搞错,直接去复制它的相对路径,然后\改为/
回答:
改成 import MetaOverview from "./echarts/MetaOverview.vue";
可以了
以上是 vue3 报错 Module not found: Error: Can't resolve ? 的全部内容, 来源链接: utcz.com/p/934412.html