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

Intended outcome: Trying to use Apollo client with React native or Vue native using code from this recipe page https://www.apollographql.com/docs/react/recipes/react-native.html

Running the iOS simulator expect to see an app or error messages directly related to my app.

Actual outcome: When running the iOS simulator I get the message:

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

Extra message is module does not exist in haste map

How to reproduce the issue: Create a fresh React or vue native instance and try using the apollo client for a simple query

Versions System: OS: macOS High Sierra 10.13.6 Binaries: Node: 10.12.0 - /usr/local/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.8.0 - /usr/local/bin/npm Browsers: Chrome: 72.0.3626.119 Safari: 12.0.3 npmPackages: apollo-client: ^2.4.13 => 2.4.13 react-apollo: ^2.4.1 => 2.4.1

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 27
  • Comments: 17 (3 by maintainers)

Most upvoted comments

apollo-utilities v1.1.3 has a dependency on graphql which is not mentioned in its package.json but it is mentioned as a peerDependency for Apollo-client to resolve it, I ran: npm install -s graphql

hey i still got error, even after installing graphql via yarn add graphql

The graphql package is a peer dependency of apollo-utilities now, which is our general policy for Apollo packages because we really don’t want multiple copies of graphql getting installed, since that throws instanceof for a loop.

For those still affected by this apollo-cache and graphql-anywhere also depend on graphql but don’t list it as a peerDependency. PR with a fix: https://github.com/apollographql/apollo-client/pull/5081

I’m getting the following error:

Failed to compile.

./node_modules/apollo-client/bundle.esm.js
Attempted import error: 'BREAK' is not exported from 'graphql/language/visitor'.

Do you guys have any idea what might cause this issue? I have graphql@^14.5.8, apollo-boost@^0.4.4 and @apollo/react-hooks@^3.1.3. Thanks for the help! 😄