I had an Angular-cli project with Angular 5.2. that I updated to Angular 7.2.3. Everything is ok, ng serve
, ng test
, but when I want to ng build --prod
I get errors
I followed the guide (https://update.angular.io/) step by step
Here are the errors :
ERROR in runtime.82c6613acef8f7246fe8.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:180:13)
at emit (internal/child_process.js:783:12)
at process._tickCallback (internal/process/next_tick.js:178:19)
ERROR in main.ae88265d57a522e8fef6.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:180:13)
at emit (internal/child_process.js:783:12)
at process._tickCallback (internal/process/next_tick.js:178:19)
ERROR in polyfills.93cd0d5603ed4cb47cce.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:180:13)
at emit (internal/child_process.js:783:12)
at process._tickCallback (internal/process/next_tick.js:178:19)
ERROR in styles.dcc46c6ff0d6be4a76ad.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:180:13)
at emit (internal/child_process.js:783:12)
at process._tickCallback (internal/process/next_tick.js:178:19)
I have no clue about what's wrong and google didn't helped me neither
Angular material update: It gives errors in some versions of angular material when running update scripts because of the update scripts do not run smoothly in some versions. What I did is updating material after getting everything done. So when I finish with all other updates, I just ran ng update @angular/material.
It’s not used after Angular 9. Inputs with number types now can not use change events, it should be switched to input event instead. Unfortunately migrate scripts won’t do this automatically for you. Resolve function can not be called with empty parameters in promise objects, it should be called at least with true.
Some versions of Angular might not work with latest version of typescript. You will need to downgrade typescript version in that case. Also be careful about other possible incompatible packages.
It’s not used after Angular 9. Inputs with number types now can not use change events, it should be switched to input event instead. Unfortunately migrate scripts won’t do this automatically for you.
That is a problem with the current version of terser, by now, you should set the version to 3.14.1 in your package.json as follows: "terser": "3.14.1",
If you have "terser": "^3.14.1",
by sure to remove the ^
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With