Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

244
Views
Angular app: es2020 migration from es2015

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?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Remember when you target ES2020 you exclude any users with iOS 13.3 and below (most likely if you're using ?? or ?.). While that version is 2+ years old it's important to check your server logs to see how many users / customers are still using (and maybe bringing revenue) with old browsers.

Unfortunately since Safari is tied to the iOS version if someone doesn't update iOS they fall behind with Safari and ES versions too.

The point is to make sure you really want to do this before doing it.

Personally I created ts.config.ES2020.app and ts.config.ES2015.app files for both and I use configuration profiles in angular.json to choose 2020 during development.

That means I'll see modern things like ?? in my development browser but that $85 we got from Safari 13.3 users the first half of this year will hopefully double!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!