Skip to content

Override whatwg-url to v14, fix punycode deprecation warning#2028

Open
Phoscur wants to merge 4 commits into
telegraf:v4from
Phoscur:2027-update-node-fetch-to-v3
Open

Override whatwg-url to v14, fix punycode deprecation warning#2028
Phoscur wants to merge 4 commits into
telegraf:v4from
Phoscur:2027-update-node-fetch-to-v3

Conversation

@Phoscur
Copy link
Copy Markdown

@Phoscur Phoscur commented Aug 31, 2024

Closes #2027

Did not have much success in easily upgrading the node-fetch dependency here, also I'm not sure how much backward compatible you want to stay..? Breaking with node.js below v18 should be ok.

This is just the easiest step possible forward, and actual upgrade to node-fetch v3 is a lot more effort!
See https://github.com/node-fetch/node-fetch/blob/main/docs/v3-LIMITS.md

@Phoscur
Copy link
Copy Markdown
Author

Phoscur commented Nov 2, 2024

Dug up this resolution comment (see other resolutions linked in there too): node-fetch/node-fetch#1793 (comment)

Reverted the node-fetch upgrade (@ maintainers, please follow up as you like) in favour of overriding the whatwg-url dependency.
Throwing in an npm audit fix on top ;)

@MKRhere please have a look!

@Phoscur Phoscur changed the title Update node-fetch to v3.3.2 Override whatwg-url to v14, fix punycode deprecation waring Nov 2, 2024
@Phoscur Phoscur changed the title Override whatwg-url to v14, fix punycode deprecation waring Override whatwg-url to v14, fix punycode deprecation warning Nov 2, 2024
@MKRhere
Copy link
Copy Markdown
Member

MKRhere commented Jan 10, 2025

Telegraf v4 started support with Node 12, and while that's too old now, I'm not sure if we should break compat within a major release. v5 is still a while away and it removes node-fetch completely in favour of native. I wonder if we should just request users to add overrides in newer versions of Node? Or considering Node may break compat in newer versions by removing the deprecated punycode module, perhaps we should break Node <18 compat after all, hmmm...

@Phoscur
Copy link
Copy Markdown
Author

Phoscur commented Jan 10, 2025

Minor version 4 update dropping node <18 compat seems the way to go imo if v5 is too far away

@siakinnik
Copy link
Copy Markdown

Hi! Upstream is dead since last year, so I've started a community fork telegraf-hardened. I'd love to have your PR there: https://github.com/siakinnik/telegraf-hardened/issues/1

@Phoscur
Copy link
Copy Markdown
Author

Phoscur commented Apr 16, 2026

✅ Implemented | Zero-Dependency Network Layer (Native Fetch) | @siakinnik | Dropped node-fetch & abort-controller, migrated to native Node.js 18+ API.

@siakinnik do you really need this PR if you dropped node-fetch?

@siakinnik
Copy link
Copy Markdown

✅ Implemented | Zero-Dependency Network Layer (Native Fetch) | @siakinnik | Dropped node-fetch & abort-controller, migrated to native Node.js 18+ API.

@siakinnik do you really need this PR if you dropped node-fetch?

Thanks for checking in! You're absolutely right, I don't need it anymore.
Feel free to check out my fork if you're interested

@Leask
Copy link
Copy Markdown

Leask commented May 5, 2026

Superseded by #2092: the v6 dependency refresh moves to node-fetch 3 and no longer carries the old whatwg-url path that produced the punycode warning.

Tracking PR: #2092

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 this pull request may close these issues.

Punycode deprecation in node.js 21

4 participants