#[SOLVED] TypeError: Promise.withResolvers is not a function
8 messages · Page 1 of 1 (latest)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers#browser_compatibility
You can see Node.js doesn't have support for that (yet).
It might not be coming anytime soon, given that it's Stage 2 Draft (https://tc39.es/proposal-promise-with-resolvers/#sec-promise.withResolvers).
https://tc39.es/process-document/
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.
It might not be coming anytime soon, given that it's Stage 2 Draft
Stage 4*
Hmm, I guess the original (ecma262) proposal wasn't good enough, so they made a new separate proposal?