Unable to resolve "src/graphql/language/visitor" from "node_modules/apollo-client/bundle.umd.js"
See original GitHub issueI’m trying to use Expo (sdk 32) + Apollo client for React Native then got message on IOS and Android:
Unable to resolve "../../src/graphql/language/visitor" from "node_modules/apollo-client/bundle.umd.js"
and my package.json:
{ “main”: “node_modules/expo/AppEntry.js”, “scripts”: { “start”: “expo start”, “android”: “expo start --android”, “ios”: “expo start --ios”, “eject”: “expo eject”, “test”: “node ./node_modules/jest/bin/jest.js --watchAll” }, “jest”: { “preset”: “jest-expo” }, “dependencies”: { “@expo/samples”: “2.1.1”, “apollo-boost”: “^0.3.1”, “apollo-cache-inmemory”: “^1.5.1”, “apollo-client”: “^2.5.1”, “apollo-link-context”: “^1.0.17”, “apollo-link-http”: “^1.5.14”, “babel-plugin-import”: “^1.11.0”, “babel-plugin-module-resolver”: “^3.2.0”, “babel-plugin-transform-react-jsx-source”: “^6.22.0”, “expo”: “^32.0.0”, “graphql”: “^14.2.1”, “graphql-tag”: “^2.10.1”, “jwt-decode”: “^2.2.0”, “moment”: “^2.24.0”, “native-base”: “^2.12.1”, “react”: “16.5.0”, “react-apollo”: “^2.5.4”, “react-native”: “https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz”, “react-native-modal”: “^9.0.0”, “react-native-svg-uri”: “^1.2.3”, “react-navigation”: “^3.0.9”, “rn-sliding-up-panel”: “^2.1.1” }, “devDependencies”: { “babel-preset-expo”: “^5.0.0”, “jest-expo”: “^32.0.0” }, “private”: true } What’s wrong with my package.json ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
🤦♂ 🤦♂ 🤦♂ 🤦♂
As usual, problem between keyboard and chair.
Working with Expo 34, I added an alias to my
babel-plugin-module-resolver
config to make reaching my compiled schema code available easier:And of course this super 🤦♂ collates with the
graphql
npm package that everything related to apollo (and Amplify / AppSync in my case) needs.Removed the ‘graphql’ part in
babel.config.js
and after running:Everything’s happilly buzzing along now!
(remember to run
expo start --clear
the first time, stuff got stuck there too…)npm install --save graphql
solved the issue for me