Skip to content

Deprecation warning of the punycode module #1587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ericfortis opened this issue Oct 25, 2023 · 14 comments
Closed

Deprecation warning of the punycode module #1587

ericfortis opened this issue Oct 25, 2023 · 14 comments

Comments

@ericfortis
Copy link

Node 21.1 deprecated punycode

[DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:3:9
    at Object.<anonymous> (…/node_modules/nodemailer/lib/mime-node/index.js:7:18)

The new documentation suggests:

Users currently depending on the punycode module should switch to using the userland-provided Punycode.js module instead. For punycode-based URL encoding, see url.domainToASCII or, more generally, the WHATWG URL API.

@charbelnicolas
Copy link

Any news on this?

@andris9
Copy link
Member

andris9 commented Nov 6, 2023

No plans to change anything for now. Nodemailer, for various reasons, has no userland dependencies, and it is fully self-contained. Creating a punycode encoder for Nodemailer so that it would work with these very old Node versions (Nodemailer supports all Node.js versions from v6.0.0) is not a priority for now. At least not until Node 22 is released.

@axkibe
Copy link

axkibe commented Nov 16, 2023

If you don't want the dependency just copy punycode.js into your source base. (License MIT)

I guess the node team made it clear, they are not maintaining it anymore, so no loss the from coping the .js instead of depending on it.. They just left it for now for backward compatibility.

PS: At least already now the warning message is annoying.

Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@AlessioGr
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Commenting so this issue isn't closed.

@sanchyanchakraborty
Copy link

Observe the identical solution using a custom automated script. #1599
@SatyanshMittal

@hulkish
Copy link
Contributor

hulkish commented Dec 24, 2023

It's going to be removed from node core at some point, so probably best to actually correct this issue by depending on punycode.js - as advised from node core for this

@andris9
Copy link
Member

andris9 commented Jan 1, 2024

Fixed in latest version

@charbelnicolas
Copy link

Fixed in latest version

I can still see the warning with version 6.9.10, is there anything else I need to do to get rid of the warning?

ss_2024_02_22_17_44_09

@lukasguldstoev
Copy link

lukasguldstoev commented Feb 27, 2024

Same issue. Fixed after updating to v20.11.1, deleting package-lock.json, node_modules and reinstalling

nvm install 20.11.1
sudo rm -rf node_modules package-lock.json
npm i

@charbelnicolas
Copy link

Oops, sorry, my bad, it was mongoose's fault. It is working as expected now!

@alvaropsouza
Copy link

Fixed in latest version

I can still see the warning with version 6.9.10, is there anything else I need to do to get rid of the warning?

ss_2024_02_22_17_44_09

still see warning here:
image

@andris9
Copy link
Member

andris9 commented Mar 2, 2024

Latest nodemailer does not use the punycode module anymore, so the warning is coming from somewhere else.

@projetos-sidnei
Copy link

projetos-sidnei commented Mar 14, 2024

I was getting this annoying warning, I updated yarn to version 4.1.1,
I updated node to version 21.7.1, deleted the node-modules folder and everything seems to be ok.
So for anyone who is having the problem, I believe this update should resolve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants