Open lifeiscontent opened 5 years ago
Is there a workaround for this?
@hwillson might know, but from what I've found currently, no.
Phew I'm also suffering from this atm. Might just go back and downgrade.
I have the same issue. I created a small repo based off on Nextjs' with-apollo
example, and described the behaviour in this SO question: https://stackoverflow.com/questions/58174010/apolllo-client-state-preset-cache-does-not-work-on-server-side-render
I do a cache-write with initial data when I init the apollo-client. However, this cache gets ignored by the SSR (first) render, where I get returned loading: true, data: undefined
. Which triggers an error, because I want to destructure the data
immediately. Second server render & client render show correct data.
The repo: https://github.com/rnacken/next-with-apollo-client-state-cache
Experiencing same issue, any workaround to this? My project contains a lot of @client directive and facing this is a pure surprise, this should be mentioned in docs if @client doesn't work on SSR.
Just ran into this issue. This completely nullfies the benefit of using Apollo as a local state management solution.
Would anyone here be able to provide a small, runnable reproduction? The repro provided in https://github.com/apollographql/react-apollo/issues/3486#issuecomment-537420370 is fixed by updating to 3.1.3, but it isn't related to the original issue here.
ping @HaNdTriX do you still have that example available showcasing the bug we ran into in the next.js repo?
I have the same issue. getDataFromTree calls render with empty apollo storage (but it's not)
Anyone found any solution for this yet? Having the same issue with local state not being read during getDataFromTree
@seankooner post a reproduction of your issue.
Meanwhile the issue can be fixed using getMarkupFromTree
inplace of getDataFromTree
.
Reference thread - https://github.com/apollographql/react-apollo/issues/3251
Met same issue. Both getMarkupFromTree and getDataFromTree don't wait until all data is fetched. And, yes, I use await. But when I log Apollo's state returned by client.extract() and props of my Root component to console, Apollo-state is being logged first and after that I see log showing me that Root component has props.loading = true
Found solution for me: I removed old react-apollo package from my project’s deps and somehow that has resolved my issue
Relevant issue here: https://github.com/zeit/next.js/pull/8673#discussion_r323275265
during SSR apollo local state should be resolved because the client may have access to the local state resolvers / cache like it does in this example.