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.

[3.0.0-beta.24] Module not found: Can't resolve 'apollo-client' in 'node_modules/@apollo/react-hooks/lib'

See original GitHub issue

Upgraded to 3.0.0-beta, everything worked until I did a hard restart of my create-react-app. Upon running my app, I receive the following error:

./node_modules/@apollo/react-hooks/lib/react-hooks.esm.js
Module not found: Can't resolve 'apollo-client' in '/Users/bstrom/dev/reviewtool/node_modules/@apollo/react-hooks/lib'

Versions System: OS: macOS Mojave 10.14.6 Binaries: Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm Browsers: Chrome: 79.0.3945.117 Firefox: 72.0.1 Safari: 13.0.4 npmPackages: @apollo/client: ^3.0.0-beta.24 => 3.0.0-beta.24 @apollo/react-hooks: ^3.1.3 => 3.1.3 @apollo/react-testing: ^3.1.3 => 3.1.3 apollo-cache-inmemory: ^1.6.5 => 1.6.5 apollo-link: ^1.2.13 => 1.2.13 apollo-link-error: ^1.1.12 => 1.1.12 apollo-link-http: ^1.5.16 => 1.5.16 apollo-server: ^2.9.7 => 2.9.15 –>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

36reactions
hwillsoncommented, Jan 18, 2020

@bstro we haven’t quite finished our migration guide yet (it should be done this upcoming week), but React Apollo’s hooks are now included in @apollo/client. You can (and should) drop your @apollo/react-hooks dependency, and instead import directly from @apollo/client.

13reactions
hatchlicommented, Mar 13, 2020

Thank you @mhuconcern ! Based on what you said, I looked into it further and realized there was a beta version of react-ssr ( “@apollo/react-ssr”: “^4.0.0-beta.1”), and that fixed it upon updating. Seems like the old ssr had the hooks dependency, and that was my problem!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Can't resolve 'apollo-client' - Stack Overflow
Tried deleting old node_modules directory and then ran npm i command but the same error was shown on the console.
Read more >
Migrating to Apollo Client 3.0 - Apollo GraphQL Docs
This article walks you through migrating your application to Apollo Client 3.0 from previous versions of Apollo Client. To illustrate the migration process, ......
Read more >
Cannot get GraphQLWsLink to work (subscriptions) -- "Can't ...
Here is the full code, basically all I need is to create a ApolloClient and export it for use in my React code....
Read more >
Get started with Apollo Client - Apollo GraphQL Docs
This short tutorial gets you up and running with Apollo Client. ... Applications that use Apollo Client require two top-level dependencies:.
Read more >
Configuring the Apollo Client cache - Apollo GraphQL Docs
Note that these keyFields strings always refer to the canonical field names defined in the schema. This means that ID computation is not...
Read more >

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