I am using typescript version 4.3.5 and node version 14.18.1. I am compiling my code targeting old as well as new browsers (target=es5
in tsconfig). I am using Promise.all as well as Promise.allSettled both in my source code.
On older browsers, specifically Safari on IPhone 8, IOS version 11, I am getting client side errors with Promise.allSettled.
As per my understanding, when using target=es5
, typescript should compile to make the code compatible with older devices hence Promise.allSettled should work. Please help me understand the issue! Following is my tsconfig.json
{
"compilerOptions": {
"sourceMap": true,
"target": "es5",
"module": "commonjs",
"esModuleInterop": true,
"outDir": "dist",
"jsx": "react",
"lib": [
"ES2020.Promise",
"dom",
"webworker"
],
"skipLibCheck": true
},
"include": [
"typings/node.d.ts",
"typings/modules.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules",
"**/*.scss.d.ts"
]
}