Module parse failed: Unexpected token (10:27)
File was processed with these loaders:
* ./node_modules/vue-loader-v16/dist/templateLoader.js
* ./node_modules/cache-loader/dist/cjs.js
* ./node_modules/vue-loader-v16/dist/index.js
You may need an additional loader to handle the result of these loaders.
vue2.*
该错误解决办法如下
vue.config.js
{
// ***********
configureWebpack: {
module: {
rules: [
{
test: /.vue$/,
use: [
{
loader: 'vue-loader',
},
],
}
],
},
}
// **************
}
接下来可能报这个错误
Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
看下vue版本和@vue/compiler-sfc版本,记得保持一致,还有一个vue-loader下载最新的
npm i @vue/compiler-sfc@latest
npm i vue-loader@next