在Vue项目上运行npm run build
时,出现以下错误:
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.
还有其他人遇到过这个问题吗?
答案 0 :(得分:5)
为您的项目安装并再次运行构建
npm i terser@4.0.0
npm run build
答案 1 :(得分:3)
如果您有vue.config.js
,则在vuejs项目上运行productionSourceMap: false
时,设置npm run build
可解决问题。
https://cli.vuejs.org/config/#productionsourcemap
module.exports = {
// other config
productionSourceMap: false
}
如果使用webpack(未测试),则sourceMap: null
https://github.com/webpack/webpack-sources/issues/28#issuecomment-342066023
然后重新运行构建(可能还需要删除package-lock.json
或node_modules
)
npm run build