问题描述
我已经更新了Angular的所有内容,现在当我
时出现以下错误(4x)构建--prod"
I have updated everything Angular and am now getting the error below (4x) when I
"Build --prod"
如果我删除--prod,则没有错误
No errors if I remove --prod
我在此应用中没有真实代码.这只是一个入门级shell.
I have no real code in this app. It is just a starter shell.
关于要研究什么的任何建议?
Any suggestions on what to look into?
ERROR in runtime.82c6613acef8f7246fe8.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/puser/Dropbox/AngularApps/GenesisFYI-v06/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:197:13)
at emit (internal/child_process.js:828:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
我当前的版本
My current Version
Angular CLI: 7.3.0
Node: 11.8.0
OS: darwin x64
Angular: 7.2.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.13.0
@angular-devkit/build-angular 0.13.0
@angular-devkit/build-optimizer 0.13.0
@angular-devkit/build-webpack 0.13.0
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cli 7.3.0
@angular/pwa 0.6.8
@ngtools/webpack 7.3.0
@schematics/angular 0.6.8
@schematics/update 0.13.0
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.0
推荐答案
最近发布的Terser 3.16版本这是 Terser和 Terser作为Webpack插件.
It seems to be a problem with the recently released version 3.16 of Terser, here's the related issue in Terser and in Terser as a Webpack plugin.
在此VueJS问题中,他们建议将其降级到版本3.14.1.您可以在package.json
中查找包含"terser"
的行并将其固定,如下所示:
In this VueJS issue they recommended to downgrade it to version 3.14.1. You can do it looking for the line in package.json
containing "terser"
and pin it as follows:
"terser": "3.14.1",
这篇关于生成--prod期间来自Terser的运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!