can't find variable self when using apollo 2.0 with react-native
See original GitHub issueI tried to upgrade apollo inside a react native project from 1.x to 2.0 but i ran into a redbox error.
Intended outcome: The app should normally render
Actual outcome:
The app breaks with a redbox which says: "cant find variable self" in fetch-npm-browserify.js

How to reproduce the issue: install apollo 2.0 in a react-native project
Version
{
"apollo-cache-inmemory": "1.0.0",
"apollo-client": "2.0.1",
"apollo-link-batch-http": "^1.0.0",
"apollo-link-error": "^1.0.0",
"apollo-link-http": "^1.1.0",
"react-apollo": "^1.4.16",
}
thanks guys for your awesome work!!
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
React Native Error - Can't find variable: self - Stack Overflow
Here I have attached a screenshot. The error is thrown from the file, located at node_modules > isomorphic-fetch > fetch-npm-browserify.
Read more >Queries - Apollo GraphQL Docs
This article shows how to fetch GraphQL data in React with the useQuery hook and attach ... If you avoid passing a variables...
Read more >React Native and Apollo: Can't find variable - appsloveworld
Coding example for the question React Native and Apollo: Can't find variable: document-React Native.
Read more >Build a GraphQL + React app with TypeScript - LogRocket Blog
Build a fully functioning React app using the SpaceX GraphQL API with TypeScript. This tutorial will walk you through each step.
Read more >GraphQL Code Libraries, Tools and Services
A simple and flexible JavaScript GraphQL client that works in all JavaScript environments (the browser, Node.js, and React Native) - basically a lightweight ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @n1ru4l! We would love if you could send a PR to upgrade
apollo-link-batch-http
to use global fetch & give the user the ability to pass in a fetcher if they would prefer. You can look at theapollo-link-http
source code for an example.apollo-link-batch-http
no longer usesapollo-fetch
, so this issue should now be resolved. Please post back if you notice otherwise. Thanks!