之前项目还没事,突然就报错了
如:in ./node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
Can't import the named export 'put' from non EcmaScript module (only default export is available);
in ./node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
Can't import the named export 'encode' from non EcmaScript module (only default export is available)
解决方法:
找到vue.config.js文件
在configureWebpack配置:
代码如下:
configureWebpack: {
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
},
]
}
}
配置完再启动项目就好了