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.

[4.3.0] getDataFromTree always issue (client side prefetch)

See original GitHub issue

When using the default config or setting { getDataFromTree: 'always' } client side prefetching won’t work

GraphQL error occurred [getDataFromTree] Invariant Violation: ReactDOMServer does not yet support Suspense.

Reproducible here: https://y8ltr.sse.codesandbox.io/ Code for above: https://codesandbox.io/s/next-with-apollo-y8ltr

Unfortunately beyond removing support for the feature there does not seem to be an obvious solution

There is an open issue on the next.js repo here https://github.com/zeit/next.js/issues/8289

If you rely on it I would recommend sticking with 4.2.0 for now

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
lfadescommented, Sep 11, 2019

@qw-in This is probably an issue with Apollo, the getDataFromTree from @apollo/react-hooks is probably not the same implementation

1reaction
ceefourcommented, Sep 20, 2019

withApollo(..., {getDataFromTree: "ssr"}) seem to “hide” the warning? I don’t know how it works (or not work) though…

Read more comments on GitHub >

github_iconTop Results From Across the Web

[getDataFromTree] Invariant Violation: Element type is invalid ...
This issue is present before refactoring render prop components to hooks. ... [4.3.0] getDataFromTree always issue (client side prefetch) ...
Read more >
Server-side rendering - Apollo GraphQL Docs
This prevents Apollo Client from refetching queries unnecessarily, and it also enables you to use the getDataFromTree function (covered below). Instead of ...
Read more >
Improve app performance with React server-side rendering
React server-side rendering offers performance benefits vs. client-side rendering. Learn about different React SSR frameworks.
Read more >
next-with-apollo - npm
In 4.3.0 all the queries where fetched on server by default ( getDataFromTree option was set to 'always' by default). In order to...
Read more >
Mastering data fetching with React Query and Next.js
are great for managing client-side only state, but they require a lot ... debounedSearchValue] , which will always be unique for our data....
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