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

Environment detection broken in Node 18 #460

Closed
lukastaegert opened this issue Sep 23, 2022 · 1 comment
Closed

Environment detection broken in Node 18 #460

lukastaegert opened this issue Sep 23, 2022 · 1 comment

Comments

@lukastaegert
Copy link

This package uses

if (typeof fetch === "function") {
  // ...
}

to detect if it is running in a browser environment. This no longer works in latest Node as fetch is now available as a regular Node global. I currently use delete global.fetch in my code to work around this, but it would be preferable if it uses a better environment sniffing algorithm, e.g. by checking for for Node-only globals.

@eemeli
Copy link
Member

eemeli commented Sep 23, 2022

Duplicate of #349.

@eemeli eemeli closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2022
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

No branches or pull requests

2 participants