Closed Connorelsea closed 3 years ago
Here is a fix I use :
require('whatwg-fetch');
// module.exports = self.fetch.bind(self);
var globalObject = typeof self === "undefined" ? global : self;
module.exports = globalObject.fetch.bind(globalObject);
This worked for me (https://github.com/apollographql/apollo-link/issues/75#issuecomment-333328069)
For all those seeking for an isomorphic-fetch with React Native support alternative, see cross-fetch. It is updated and also brings optional polyfill.
graphql-request and VulcanJS are already using it.
Are there any plans to make an update to fix this?
npm add whatwg-fetch@2.0.4 --save
Hello.
I am using
redux-api-middleware
which is using version 2.2.1 ofisomorphic-fetch
. I am experiencing an error whereself
is undefined in React Native, which is a problem with this version ofisomorphic-fetch
. Most issues I have seen regarding this issue have been closed, but I feel that this is a fairly common issue and I have not been able to find a good solution. I'd love to work together, with a maintainer or anyone else having this problem, to solve it.Thank you for reading and for your work on this library.
The error seems to be coming from this file:
Here is the stack trace: