-
Notifications
You must be signed in to change notification settings - Fork 54
Suppress punycode warnings for both CLI and the app #1579
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
Conversation
gcsecsey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@sejas thanks for confirming. I tried again, and reproduced. |
|
yep, all good, I was able to reproduce it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm this PR hides the punycode warning with code DEP0040.
It would be interesting to track an issue if upgrading some dependencies can fix the issue in the future.
Before:
❯ node dist/cli/main.js --help
(node:31152) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
WordPress Studio CLI
Commands:
studio preview Manage preview sites
Options:
--help Show help [boolean]
--version Show version number [boolean]
--path Path to the WordPress files [string] [default: Current directory]
You must provide a valid command
After
❯ node dist/cli/main.js --help
WordPress Studio CLI
Commands:
studio preview Manage preview sites
Options:
--help Show help [boolean]
--version Show version number [boolean]
--path Path to the WordPress files [string] [default: Current directory]
`
|
Here are the dependencies that use punycode. I suspect that I didn't see the error at first because I was experimenting with the latest playground dependencies. We can revisit if we can remove this custom code after we update to Blueprints 1.2.3+. |
|
@sejas the trick is that the warning doesn't come from NPM dependencies you showed in the The warning thrown from We could pursue it further, but even if we fix it, it can resurface if any other dependency starts using Node's punycode. |
|
Yeah, I think it makes sense to merge this PR. But I also think that from time to time, if we upgrade a dependency that includes punycode, we should check if this warning is gone. My feeling is that |
|
@sejas, @wojtekn, also there is the For example, Additionally, we can temporarily use
Then delete the |
|
@epeicher thanks for sharing those steps. As I mentioned above, it's not really about an NPM dependency that uses punycode as NPM dependency. It's about some dependency that loads NPM's punycode module which is deprecated since Node 22 - as far as I see, at least |



Related issues
Proposed Changes
Installing punycode as an explicit dependency didn't help - there is some dependency that loads deprecated punycode.
Testing Instructions
Pre-merge Checklist