An ugly fix to a ng build error in my latest Angular update

In my most recent update for Zzpace(Angular) I ran into some an error on the production build after using the ng build that comes with Angular CLI.

Upon doing a post request on my login page, I was receiving an undefined variable error from the Angular front-end.

After digging into some github issues a bit, I noticed a similar issue and how to resolve my issue.

In a commit I had to change an angular cli angular.json setting optimization, from true to false. Unfortunately my ng build dist size has gone from 1.7mb to 8mb since this change, but I am able to run my Angular error free now.

Is this fix ideal? Nope, but it is a temporary fix until I can find a cleaner solution.

Leave a Reply

Your email address will not be published. Required fields are marked *