Skip to content
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

Dependency is-valid-domain is deprecated #97

Open
TobiasDeBruijn opened this issue May 29, 2024 · 2 comments · May be fixed by #100
Open

Dependency is-valid-domain is deprecated #97

TobiasDeBruijn opened this issue May 29, 2024 · 2 comments · May be fixed by #100

Comments

@TobiasDeBruijn
Copy link

Hi,

I came across devcert in my dependency tree (through gatsby) after getting a warning about punycode:

The `punycode` module is deprecated. Please use a userland alternative instead.

The punycode dependency is used by is-valid-domain, who use it wrong, producing the error.
However, is-valid-domain is archived on GitHub and was last updated on npm two years ago. is-valid-domain is used by this package.

I'm not entirely sure what the best fix would be. Forking is-valid-domain could be an option, then fixing the require('punycode') to require('punycode/') (which should fix the warning) and then use that fork, is one option.

Thanks.

@stefanvanherwijnen
Copy link

https://stackoverflow.com/a/78014024

It looks like is-valid-domain only uses punycode.toASCII() so this is probably best solved by forking it and using url.domainToASCII(domain) instead.

Or use a different package for domain validation, e.g.: https://www.npmjs.com/package/parse-domain

@tebeco
Copy link

tebeco commented Aug 29, 2024

https://stackoverflow.com/a/78014024

It looks like is-valid-domain only uses punycode.toASCII() so this is probably best solved by forking it and using url.domainToASCII(domain) instead.

Or use a different package for domain validation, e.g.: https://www.npmjs.com/package/parse-domain

This is irrelevant to the entire issue

this repo is using directly is-valid-domain not punycode
node is deprecating punycode which for this repo would ideally have been to update is-valid-domain

but none of that is relevant since is-valid-domain is archived
whatever is-valid-domain code is doing with punnycode will never change anymore (archived)

This repo would need to replace is-valid-domain or fork it + update the fork to remove punnycode

EDIT (i missed that part):

Or use a different package for domain validation, e.g.: https://www.npmjs.com/package/parse-domain

this would be ideal, yes

@jpbarela jpbarela linked a pull request Dec 22, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants