TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
871 stars 229 forks source link

fix: `URL` imports for Node 14 #289

Closed danielbankhead closed 4 months ago

danielbankhead commented 4 months ago

The following PR introduced a regression in Node 14, as that version of node doesn't support node:url.

Original issue:

changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: bbb4c396f77b4e8384a74842661b86c36ed1d209

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ----------------- | ----- | | http-proxy-agent | Patch | | https-proxy-agent | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
proxy-agents ✅ Ready (Inspect) Visit Preview Feb 15, 2024 6:57pm
TooTallNate commented 4 months ago

This really should not be necessary. node:url import works even on Node 14. The error probably comes from a bundler which does not understand that syntax.

Anyways, I'll merge this because there have been a few reports of this error and I'm tired of trying to explain to people that it's a misconfiguration on their end 🤷

danielbankhead commented 4 months ago

Thanks for merging. You are correct that it does work in Node 14, but not all versions of 14 (and technically the engines field includes 14.0.0):

Screenshot 2024-02-15 at 12 09 31 PM