Having trouble getting Angular to function properly in IE 11. I've tried all the solutions I could find online.
The errors I'm encountering are as follows:
SCRIPT1002: Syntax error
File: vendor.js, Line: 110874, Column: 40
At line 110874
args[0].replace(/%[a-zA-Z%]/g, match => {
if (match === '%%') {
return;
}
index++;
if (match === '%c') {
// We only are interested in the *last* %c
// (the user may have provided their own)
lastC = index;
}
});
I have already implemented the recommended ES5 configurations suggested by Angular and am running with these settings (https://angular.io/guide/deployment Configuring serves for ES5).
Here's my polyfills.ts file content:
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
import 'classlist.js'; // Run `npm install --save classlist.js`.
/** IE10 and IE11 requires the following for the Reflect API. */
import 'core-js/es6/reflect';
import 'web-animations-js'; // Run `npm install --save web-animations-js`.
import 'zone.js/dist/zone'; // Included with Angular CLI.
My tsconfig.json looks like this:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
}
And here's my tsconfig.es5.json file:
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es5"
}
}
I'm using Angular 8 along with Primeng, and running with ng serve --configuration es5;
Update: After some investigation, it appears that the issue is related to the dependencies of the socket-io-client I'm using. Upon further research, it seems that the problem lies within the debug and babel dependencies of socket-io-client. Since I need to utilize the socket on my system, I'm still searching for a solution. However, removing the socket-io-client allows the application to run smoothly.
I identified the root cause of the problem through these two discussions: