question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to resolve "src/graphql/language/visitor" from "node_modules/apollo-client/bundle.umd.js"

See original GitHub issue

I’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:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
aldegoeijcommented, Aug 29, 2019

🤦‍♂ 🤦‍♂ 🤦‍♂ 🤦‍♂

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:

"babel-plugin-module-resolver",
{
  root: ["./"],
     alias: {
       assets: "./assets",
       graphql: "./src/graphql",
     },
   },
}

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:

watchman watch-del-all && rm -rf ./.cache && rm -rf ./.expo && rm -rf ./public && rm -rf ./node_modules 
yarn install

Everything’s happilly buzzing along now!

(remember to run expo start --clear the first time, stuff got stuck there too…)

11reactions
awilderinkcommented, May 6, 2019

npm install --save graphql solved the issue for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found