Promise.withResolvers() returns an object with three properties: promise, resolve, and reject. Calling resolve(value) or reject(reason) later, from outside any callback, settles that promise. It replaces the old trick of copying resolve and reject out of a new Promise(...) executor. A promise settles only once.
Remember
const { promise, resolve, reject } = Promise.withResolvers();
promise → pending until you settle it
resolve(v) → fulfill promise with v
reject(e) → reject promise with e
first call wins, later calls do nothing
Syntax
Call it with no arguments and pull out the parts you need with destructuring.
Many readers, one result. Readers A and B were added before settlement. Both get the same value, in the order they were added.
Only the first call counts.markReady('second') and markFailed(...) do nothing. The promise stays fulfilled with first and never rejects.
Late readers still get it. Reader C is added after settlement and still prints first. typeof markReady is function, so the resolvers are ordinary functions.
Compatibility
Browser & Runtime Support
Promise.withResolvers() is part of ES2024.
✓ Newer · ES2024
Promise.withResolvers()
Chrome 119+, Edge 119+, Firefox 121+, Safari 17.4+, and Node.js 22+ (examples run on Node.js 24). Not in Internet Explorer.
RecentRecent browsers only
Google ChromeChrome 119+
Supported
Mozilla FirefoxFirefox 121+
Supported
Apple SafariSafari 17.4+
Supported
Microsoft EdgeEdge 119+
Supported
Node.jsNode.js 22+
Supported
DenoRecent versions
Supported
Internet ExplorerNo support
Not supported
Promise.withResolvers()Recent browsers
Bottom line: Feature-detect with typeof Promise.withResolvers === "function". Fallback: declare let resolve, reject, create the promise with new Promise((res, rej) => { resolve = res; reject = rej; }), and use them as before.
Frequently Asked Questions
A plain object with three properties: promise (a pending promise), resolve (fulfills it), and reject (rejects it). Use destructuring to take what you need.
With new Promise() the resolve and reject functions only exist inside the executor. To settle from elsewhere you had to copy them to outer variables. withResolvers() hands them over directly.
No. The first call to resolve or reject decides the result. Later calls are ignored without an error.
Yes. If you call reject and nobody has a catch() handler, it is an unhandled rejection, and Node.js 15 and newer stops the program.
It is ES2024: Chrome 119, Edge 119, Firefox 121, Safari 17.4, and Node.js 22 or newer. Older browsers can use the new Promise() capture trick.