Skip to content

util: runtime deprecate `promisify`-ing a function returning a `Promise`

My goal would be for this deprecation to never reach EOL, and stay as runtime deprecated forever. The warning it produces should help folks who run into the linked issue figure out what's happening.

// file.js

const promisified = promisify(async () => {});

promisified();

node --trace-warnings file.js will show at file.js:5:1 – so not where the promisify call happened, but where the promisified function was called. Hopefully that will give enough info to debug it.

Fixes: https://github.com/nodejs/node/issues/49607

Merge request reports

Loading