[DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.
Describe the bug
Node.js version: v21.7.1
OS version: macOS 14.4
Description: Started getting a node DeprecationWarning originating from line: https://github.com/forwardemail/email-templates/blob/e8b8cfced71077a9401f6fd03c6ae8369766978a/index.js#L249
Actual behavior
Test/usage output includes the following deprecation warnings.
(node:60785) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.
at node:internal/util:431:17
at new Promise (<anonymous>)
at node:internal/util:416:12
at Email.render (/Users/bret/Developer/email-templates/index.js:249:47)
at async Promise.all (index 2)
at Email.renderAll (/Users/bret/Developer/email-templates/index.js:263:37)
at Email.send (/Users/bret/Developer/email-templates/index.js:333:20)
at async /Users/bret/Developer/email-templates/test/test.js:233:9
(node:60785) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.
at node:internal/util:431:17
at new Promise (<anonymous>)
at node:internal/util:416:12
at Email.render (/Users/bret/Developer/email-templates/index.js:249:47)
at async Promise.all (index 1)
at Email.renderAll (/Users/bret/Developer/email-templates/index.js:263:37)
at Email.send (/Users/bret/Developer/email-templates/index.js:333:20)
at async /Users/bret/Developer/email-templates/test/test.js:233:9
✔ send two emails with two different locals
Expected behavior
It should avoid running promisify on promise returning functions.
✔ send two emails with two different locals
Code to reproduce
Run npm test running on node 21.
Checklist
- [x] I have searched through GitHub issues for similar issues.
- [x] I have completely read through the README and documentation.
- [x] I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
Seeing the same behavior here, would be great if it could be looked into!
Same issue in my product, please help to take a look.
Please submit a PR if you'd like to fix this.
I may revisit if I find time but anyone else feel free to take a stab at it.
PR welcome