Angular-cli: es2015 production build fails

Created on 11 Feb 2018  路  3Comments  路  Source: angular/angular-cli

Everything works fine when built with target=es5

Angular CLI: 1.6.8
Node: 8.9.3
OS: linux x64
Angular: 5.2.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.2.0
@angular/cli: 1.6.8
@angular/flex-layout: 2.0.0-beta.12
@angular/material: 5.2.0
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack-bundle-analyzer: 2.10.0
webpack: 3.10.0

ERROR in main.7847a252fa3ce1dc3b32.bundle.js from UglifyJs
TypeError: sym.definition is not a function
    at may_modify (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:8931:31)
    at TreeTransformer.abort [as before] (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:8541:74)
    at AST_VarDef.eval [as transform] (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4570:35)
    at eval (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4586:25)
    at doit (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:130:23)
    at MAP (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:156:52)
    at do_list (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4585:16)
    at eval (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4664:28)
    at AST_Const.eval [as transform] (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4573:17)
    at collapse (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:8617:39)
    at tighten_body (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:8429:17)
    at eval (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:10534:9)
    at AST_BlockStatement.eval [as optimize] (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:7682:23)
    at Compressor.before (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:7665:24)
    at AST_BlockStatement.eval [as transform] (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4570:35)
    at eval (eval at <anonymous> (/exec/desktop/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-es/tools/node.js:21:1), <anonymous>:4638:31)

How to reproduce:

ng build --prod

blocked devkibuild-angular medium regression bufix

Most helpful comment

Temporary workaround, according to @arackaf, is to put this versions in package.json:

"uglify-es": "3.3.9",
"uglifyjs-webpack-plugin": "1.1.8"

In my case, build es2015 passes.

All 3 comments

Temporary workaround, according to @arackaf, is to put this versions in package.json:

"uglify-es": "3.3.9",
"uglifyjs-webpack-plugin": "1.1.8"

In my case, build es2015 passes.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings