Whenever I work on an Angular project, the browser console usually remains error-free. However, when I opt to include
projects > project-name > architect > build > options > "optimization": false
in the angular.json
file to deactivate JavaScript minification, two errors pop up:
(1) Upon loading the app:
Source map error: Error: request failed with status 404
Resource URL: http://localhost:4200/main.js
Source Map URL: ngx-echarts.mjs.map
(2) When trying out the app's functionalities:
ERROR TypeError: ctx.formData is undefined
...
globalZoneAwareCallback http://localhost:4200/polyfills.js:12156
The problematic code appears to be:
var globalZoneAwareCallback = function (event) {
return globalCallback(this, event, false);
}; // global shared zoneAwareCallback to handle all event callback with capture = true
...
In relation to error (1), even after ensuring that the source maps are enabled in my browser (Firefox) as suggested by one response, the issue persists. Despite having what seems like source maps
activated, I am still encountering this error. How can I access the original non-minified version of the script?
Regarding error (2), the reason behind this specific error occurrence upon deactivating JavaScript minification eludes me. Why does this only happen in such a scenario?