I'm facing an issue in loading an integrated amchart with typescript app in IE 11.
App node module versions
"@types/node": "^10.9.4",
"typescript": "2.9.1",
"@amcharts/amcharts4": "^4.10.13",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
I'm getting the following error when executing this line of code in IE 11.
const chart = am4core.create("chartdiv", am4maps.MapChart);
The error is
**SCRIPT1002 : syntax error**
I have tried adding support to arrow function as the error is happening for arrow function
/* harmony default export */ __webpack_exports__["default"] = (function(f) {
let delta = f;
let compare = f;
if (f.length === 1) {
delta = (d, x) => f(d) - x; // Error Here
compare = ascendingComparator(f);
}
})
I've tried
- installing
@babel/plugin-transform-arrow-functions
and specifying it as a plugin in babelrc. - In
tsconfig.json
changed the target to es5 - Imported the necessary polyfills in
polyfills.ts
file - added rules to support in
webpack.config
Also most of the solutions in stackoverflow I tried. But still this error is not resolved . Could you please help me on this
core-js
polyfill? If not, I suggest you add it by running thenpm install core-js @types/core-js regenerator-runtime
command and try to addimport "core-js/stable";
at the top of the TypeScript / JavaScript code. This must be put before everything else, or it won't work! Please see Polyfill for older browsers.core-js
polyfill? If yes, please inform us about it. Are you trying to use Force Directed Tree plugin? If yes, it is not supported in the IE browser.core-js
polyfill? To see whether it makes any difference.