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.

Facing migration issue with apollo-client@2.6.8 to @apollo/client@3.2.7

See original GitHub issue

Intended outcome:

it could be run as of migration guide said.

Actual outcome:

I don’t get is that have peer dependancy with apollo-client. I followed migration steps from official documentation

ERROR in /node_modules/@apollo/react-common/lib/context/ApolloConsumer.d.ts(2,26):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/react-common/lib/context/ApolloContext.d.ts(2,26):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/react-common/lib/context/ApolloProvider.d.ts(2,26):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/react-common/lib/types/types.d.ts(1,221):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/react-hoc/lib/types.d.ts(1,147):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/react-hooks/lib/data/OperationData.d.ts(1,30):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/react-hooks/lib/data/QueryData.d.ts(1,35):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/react-hooks/lib/ssr/RenderPromises.d.ts(2,33):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/react-hooks/lib/types.d.ts(3,60):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/react-hooks/lib/useApolloClient.d.ts(1,26):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/react-hooks/lib/useSubscription.d.ts(8,20):
TS2307: Cannot find module 'apollo-client'.
ERROR in /node_modules/@apollo/client/core/ObservableQuery.d.ts(22,9):
TS1086: An accessor cannot be declared in an ambient context.

How to reproduce the issue:

while I migrated from apollo-client@2.6.8 to @apollo/client@3.2.7

Versions

System: OS: macOS 10.15.6 Binaries: Node: 12.7.0 - ~/.nvm/versions/node/v12.7.0/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.8 - ~/.nvm/versions/node/v12.7.0/bin/npm Browsers: Chrome: 86.0.4240.198 Safari: 14.0

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
benjamncommented, Feb 9, 2021

For getDataFromTree, you can do

import { getDataFromTree } from "@apollo/client/react/ssr"

As for the jscodeshift error, you need to temporarily clone this repository into the directory where you’re running the npx jscodeshift command, or clone it somewhere else and adjust the path to refer to that directory. The README.md for the codemod covers this step (“Note that the apollo-client directory…”).

0reactions
hwillsoncommented, May 15, 2021

Let us know if this is still a concern with @apollo/client@latest - thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Pitfalls I fell into during Apollo Client 3.0 migration
Recently I worked on migrating Apollo Client to 3.0 from 2.6 in our project. ... This issue happens because Apollo checks options update...
Read more >
Migration Guide – Angular - GraphQL Code Generator
Updating your app to Angular Apollo v3.
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