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

ESM #429

Open
jimmywarting opened this issue Sep 7, 2021 · 8 comments · May be fixed by #617
Open

ESM #429

jimmywarting opened this issue Sep 7, 2021 · 8 comments · May be fixed by #617
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@jimmywarting
Copy link

jimmywarting commented Sep 7, 2021

This 2 are outdated...

gaxios/package.json

Lines 91 to 92 in a64f344

"is-stream": "^2.0.0",
"node-fetch": "^2.6.1"

You are getting attacked by not one person (Sindre) that is converting all of his 1000+ packages to ESM-only
but now you also have two libraries that pushes for ESM only. node-fetch@3 (one of the most popular http library for NodeJS) went ESM-only too.

Where do you stand in this regards?

We (node-fetch) suggested to others who can't make the switch ESM to do the dynamic import('node-fetch') from commonjs while still using the latest version

@bcoe bcoe added the type: question Request for information or clarification. Not an issue. label Sep 7, 2021
@JustinBeckwith
Copy link
Contributor

Greetings @jimmywarting! At this stage, we still have a high number of customers running on Node.js 10.x. We've made the decision to hang onto Node 10.x support for a while longer, most likely until the deprecation of Node.js 12.x. When our dependencies move to an ESM-only model, as you call out, it puts unfortunate pressure on us to introduce a breaking change to our users. We read from the changelog that the 2.x line of node-fetch would continue to receive critical bug fixes and security patches. Is that still true?

@jimmywarting
Copy link
Author

jimmywarting commented Sep 7, 2021

would continue to receive critical bug fixes and security patches. Is that still true?

Yep, we understand that everyone can't update to esm right now so they will be stuck with cjs for a while longer.
It doesn't mean we will leave them hanging. bug fixes and security patches will still be on the table.
One minor patch fix was fixed in v2 after we released V3 about the main path missing a extension in package.json

@JustinBeckwith
Copy link
Contributor

Excellent 😄

@yumetodo
Copy link

ref: #445

@alexander-fenster alexander-fenster added the priority: p3 Desirable enhancement or fix. May not be included in next release. label Jul 21, 2022
@marck283
Copy link

marck283 commented Sep 28, 2023

@JustinBeckwith Node.js versions up until version 19 are now deprecated (see here). Furthermore, upgrading node-fetch to at least version 3.2.10 would solve a memory leak issue (see here) and a Regular Expression Denial of Service issue (as can be seen here). Is there a chance that an ESM-only version of googleapis/gaxios will be published? This way, those running an outdated version of Node.js (13.2 and above) that does not support ESM import instructions should still be able to use CommonJS's dynamic import while making use of the latest fixes introduced by node-fetch.

@stevedrobinson
Copy link

stevedrobinson commented Nov 30, 2023

After upgrading to node 21, I now get:
DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
because node-fetch 2.x still uses that library. I'm afraid this is more pressure to make the change...

@mediakreativ
Copy link

After upgrading to node 21, I now get: DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. because node-fetch 2.x still uses that library. I'm afraid this is more pressure to make the change...

I just received this error after installing googleapis as well. Strange that it has not been fixed yet...

@danielbankhead
Copy link
Member

Upgrading to node-fetch v3 in this PR:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants