getsentry / sentry-cli

A command line utility to work with Sentry.
https://docs.sentry.io/cli/
BSD 3-Clause "New" or "Revised" License
898 stars 221 forks source link

Upgrade to node-fetch v3 to avoid punycode deprecation warning #1810

Open andrews05 opened 11 months ago

andrews05 commented 11 months ago

On node 21, using sentry cli shows a warning: DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Here's the dependency stack leading to punycode:

@sentry/cli@npm:2.21.2
node-fetch@npm:2.7.0
whatwg-url@npm:5.0.0
tr46@npm:0.0.3
punycode

Upgrading to node-fetch v3 should resolve this. I believe this will require bumping minimum node to v12, hopefully that won't be issue.

loewenheim commented 10 months ago

Hi, thank you for the report. I'll put it on the backlog for now.

emmgfx commented 6 months ago

Any news about this? Node 21 was released 5 months ago :(

szokeasaurusrex commented 6 months ago

@emmgfx Since implementing this change would require increasing the minimum Node version, this change likely should wait until we release a new major version of the CLI.

If this deprecation warning is a major annoyance, we could perhaps look into whether we might be able to suppress the warning in the meantime.

mo commented 2 weeks ago

node v22 is very soon LTS and this punycode warning is really annoying... can you please upgrade to node-fetch 3.x? since other very common packages like jsdom and jest has already upgraded to node-fetch 3.x a very large amount of apps cannot support node v10 anyway.. of course if there is a way to silence the warning this would also be a good solution

mo commented 2 weeks ago

running with NODE_OPTIONS="--disable-warning DEP0040" will disable the deprecation warning for punycode

szokeasaurusrex commented 2 weeks ago

Hi @mo, as I mentioned in a previous comment, this likely requires us to release a major version of Sentry CLI because it would be a breaking change. We have no timeline on when we would plan to do this.

running with NODE_OPTIONS="--disable-warning DEP0040" will disable the deprecation warning for punycode

If I understand correctly, you are able to disable the warning and work around this issue, right?

mo commented 2 weeks ago

Yes, suppressing the warning with --disable-warning DEP0040 works well in my case.