I have just updated my app to Angular 12 and am trying to use es2020. For some reason I am still getting errors when my app builds because it seems the app is still trying to use es2015:
node_modules/typescript/lib/lib.es2015.promise.d.ts:33:34
[ng] 33 new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
[ng] ~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] An argument for 'value' was not provided.
I've updated tsconfig.json
to reflect es2020:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"inlineSources": true,
"declaration": false,
"sourceRoot": "/",
"module": "es2020",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2020",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2020",
"dom"
]
},
"exclude": [
"node_modules",
"**.*.spec.ts",
"plugins/**"
]
}
EDIT:
When I serve my app I also see the following:
[ng] Compiling @angular/core : es2015 as esm2015
[ng] Compiling @ionic-native/core : module as esm5
[ng] Compiling @angular/common : es2015 as esm2015
[ng] Compiling @angular/cdk/collections : es2015 as esm2015
[ng] Compiling @ionic-native/splash-screen : module as esm5
[ng] Compiling @ionic-native/barcode-scanner : module as esm5
[ng] Compiling @ionic-native/status-bar : module as esm5
[ng] Compiling @angular/platform-browser : es2015 as esm2015
[ng] Compiling @angular/cdk/platform : es2015 as esm2015
Lastly, I am already using Typescript 4.3.5 in my package.json
.
But I have not explicitly installed any new typings since making the change. What do I do next to allow the change to es2020?