#[SOLVED] TypeError: Promise.withResolvers is not a function

8 messages · Page 1 of 1 (latest)

upper echo
#

Hello!
What settings I have to add in tsconfig.json to allow Promise.withResolvers at runtime?
typescript package version is 5.4 so it's available in the TypeScript side.

Info will be appreciated.

warm pagoda
#

So, to your tsconfig you should add (under compilerOptions):

    "lib": ["ES2022"],
    "target": "es2022",

Which should put typescript in line with what Node.js 18+ supports.

upper echo
#

Thank you a lot!!!

#

[SOLVED] TypeError: Promise.withResolvers is not a function

upper echo
#

It might not be coming anytime soon, given that it's Stage 2 Draft

Stage 4*

warm pagoda
#

Hmm, I guess the original (ecma262) proposal wasn't good enough, so they made a new separate proposal?