在npm run buildVue项目上运行时,出现以下错误:
Unhandled rejection Error: original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.
还有其他人遇到过这个问题吗?
小智 5
为您的项目安装并再次运行构建
npm i terser@4.0.0
npm run build
Run Code Online (Sandbox Code Playgroud)
如果有vue.config.js,设置可以解决在 vuejs 项目上productionSourceMap: false运行时的问题。npm run build
https://cli.vuejs.org/config/#developmentsourcemap
module.exports = {
// other config
productionSourceMap: false
}
Run Code Online (Sandbox Code Playgroud)
如果使用 webpack(未测试),那么sourceMap: null
https://github.com/webpack/webpack-sources/issues/28#issuecomment-342066023
然后重新运行构建(可能还需要删除package-lock.json或node_modules)
module.exports = {
// other config
productionSourceMap: false
}
Run Code Online (Sandbox Code Playgroud)