Terser: ERROR while ng build --prod

Created on 2 Feb 2019  路  6Comments  路  Source: terser/terser

ERROR while ng build --prod

Most helpful comment

From what I saw in another issue there was a breaking change introduced with a recent commit which affects the terser-webpack-plugin. This was the cause for my failed build and I suppose it could be the same for yours as well. It will probably be patched soon. 馃檪

EDIT: This fixed it for me.

All 6 comments

From what I saw in another issue there was a breaking change introduced with a recent commit which affects the terser-webpack-plugin. This was the cause for my failed build and I suppose it could be the same for yours as well. It will probably be patched soon. 馃檪

EDIT: This fixed it for me.

@AlexKondov can confirm that also fixed my production compilation in a Laravel project using yarn / laravel-mix to compile my assets.

Yes, downgrading to Terser 3.14.1 fixed the issue.

Same issue here with ng build --prod. "TypeError: Cannot read property 'minify' of undefined" in terser-wepback-plugin

Same issue here with ng build --prod. "TypeError: Cannot read property 'minify' of undefined" in terser-wepback-plugin

One way to do it is to add terser v3.14 into your package.json. That fixed for me. Although, it is recommended to lock the version of the dependency tree.

Fixed in 3.16.1. Will add test so it doesn't happen again. Thanks for the issue!

Was this page helpful?
0 / 5 - 0 ratings