In an Angular project, I usually don't see an error in the browser console when I load the project. But when I add projects > project-name > architect > build > options > "optimization": false to angular.json, in order to disable javascript minification, I then see the following two errors:
(1) When the app is loaded:
Source map error: Error: request failed with status 404
Resource URL: http://localhost:4200/main.js
Source Map URL: ngx-echarts.mjs.map
(2) And when I try using the app, I am getting this error:
ERROR TypeError: ctx.formData is undefined
...
globalZoneAwareCallback http://localhost:4200/polyfills.js:12156
This code seems to be:
var globalZoneAwareCallback = function (event) {
return globalCallback(this, event, false);
}; // global shared zoneAwareCallback to handle all event callback with capture = true
...
As for error (1), from what I read in another answer, I need to enable source maps in my browser (Firefox). As far as I can see source maps is enabled, but I'm still getting this error. So how can I get the original non-minified version of the script?
As for error (2), I could not find out why this error is thrown. Why is this error thrown only when javascript minification is disabled?