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

Stop polluting the global namespace with fetch #383

Closed
aaomidi opened this issue Apr 15, 2020 · 1 comment · Fixed by #414
Closed

Stop polluting the global namespace with fetch #383

aaomidi opened this issue Apr 15, 2020 · 1 comment · Fixed by #414
Labels

Comments

@aaomidi
Copy link

aaomidi commented Apr 15, 2020

const globalWithFetch = global as GlobalWithFetch;

As a self-contained library, doing this can cause havoc on other users. Lots of dual browser and node libraries check the global namespace for fetch before defaulting to requiring.

This code is essentially forcing its own flavor of node-fetch onto everything else that follows that same practice.

It shouldn't be necessary to pollute the global namespace like this.

@xirzec
Copy link
Member

xirzec commented Sep 22, 2020

Seems like we could port Azure/azure-sdk-for-js#9880

@jeremymeng jeremymeng added the bug label Jan 27, 2021
jeremymeng added a commit to jeremymeng/ms-rest-js that referenced this issue Jan 29, 2021
Porting fix from Azure/azure-sdk-for-js#9880.
Use import node_fetch from "node-fetch" instead of import "node-fetch".

Resolves Azure#383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants