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.

Error with Apollo data fetching and Next 9

See original GitHub issue

Bug report

Describe the bug

After upgrading to Next 9, I’ve encountered an issue when I am trying to use Apollo together with getInitialProps on client-side as well (e.g. condition on this line is removed).

When clicking between pages, which are trying to fetch data inside getInitialProps an error: Error while running getDataFromTree Invariant Violation: ReactDOMServer does not yet support Suspense. occurs.

image

To Reproduce

Repo: https://github.com/prichodko/next-with-apollo-issue

  1. Start app
  2. Open console and click between pages

Expected behavior

Fetch data without the error.

System information

  • OS: macOS
  • Version of Next.js: latest

I am not 100% sure if it’s a Next or Apollo’s issue. But since it was working with Next 8 I opened it here. I am happy to try to help with the issue.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:21
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

9reactions
iam4xcommented, Nov 4, 2019

Hi @Timer, I’m looking at the commits of with-apollo example but cannot find the update you are referencing https://github.com/zeit/next.js/commits/canary/examples/with-apollo ?

1reaction
ceefourcommented, Sep 14, 2019

Thanks @iam4x. Is there bug/issue (or plan to file) in @apollo/react-hooks ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling operation errors - Apollo GraphQL Docs
These are errors encountered while attempting to communicate with your GraphQL server, usually resulting in a 4xx or 5xx response status code (and...
Read more >
Calling ApolloClient query inside getStaticProps - Error
I have the following getStaticProps() function in my pages/index.tsx file to fetch data from a GraphQL and ...
Read more >
How to Fetch GraphQL Data in Next.js with Apollo GraphQL
import { ApolloClient, InMemoryCache, gql } from '@apollo/client'; This is going to include the Apollo Client itself, InMemoryCache which ...
Read more >
Apollo Client Cache Rehydration in Next.js
Thankfully, there is a way to fetch data on the server, populate Apollo Client's cache, send that cache data to the client, and...
Read more >
Get Started – Angular - GraphQL Code Generator
Apollo Client automatically caches this data when it comes back from the server, so you won't see a loading indicator if you run...
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