Error with Apollo data fetching and Next 9
See original GitHub issueBug 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.
To Reproduce
Repo: https://github.com/prichodko/next-with-apollo-issue
- Start app
- 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:
- Created 4 years ago
- Reactions:21
- Comments:12 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 ?Thanks @iam4x. Is there bug/issue (or plan to file) in
@apollo/react-hooks
?