You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In non-browser execution environments, self typically doesn't exist. It seems to me that to avoid errors while loading the script, it'd be nice if fetch would failover to use an equivalent global instead - only if self isn't available.
An additional benefit is that this would improve support for very old browsers which don't have self (which was added in HTML5).
The purpose of this change is not to provide support for non-browser environments, but to avoid crashing those environments when the script is included. This happens, for example, when including isomorphic-fetch in React Native due to the way it packages the node modules.
Would you be open to considering a PR which implements this?
The text was updated successfully, but these errors were encountered:
Because this library is designed for, and tested in, browser environments, we don't have a way to ensure future changes won't break compatibility with React Native. The discussion in #125 might lead to a workaround.
Unfortunately, it doesn't. As react native packages all the JS files together, and fetch doesn't support modularization, it runs regardless of whether it is required or not.
In non-browser execution environments,
self
typically doesn't exist. It seems to me that to avoid errors while loading the script, it'd be nice if fetch would failover to use an equivalent global instead - only ifself
isn't available.An additional benefit is that this would improve support for very old browsers which don't have
self
(which was added in HTML5).The purpose of this change is not to provide support for non-browser environments, but to avoid crashing those environments when the script is included. This happens, for example, when including
isomorphic-fetch
in React Native due to the way it packages the node modules.Would you be open to considering a PR which implements this?
The text was updated successfully, but these errors were encountered: