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.

Cannot have it work with with-apollo nextjs example

See original GitHub issue

Hello. First of all thank you for this really cool project 🍪 I am having a hard time making SSR work with this plugin and Apollo Client, following the official example. I created the HOC for Apollo and then in my _app.js I am doing export default appWithTranslation(withApollo(MyApp)). Still when running getDataFromTree the HOC for Apollo complains that the router is missing. I think that might be due to the fact that here the router is not provided to the wrapped _app. I edited the code locally to add the router in the HOC and then I had issues with the withNamespaces complaining about i18nOptions missing during some render.

The main thing is that client side render works, but not the SSR. I am missing something ? I put together a simple Sandbox to show the issue https://codesandbox.io/s/3422zvo61q (you may need to clone this, cannot have it work on the Sanboxsite 🤔 )

Thank you for your help.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
nicolas-mariencommented, Dec 19, 2018

@isaachinman Thank you so much. That solved it all! Also thanks to @MathiasKandelborg and @kachkaev Merry Xmas to all 😃

1reaction
isaachinmancommented, Dec 19, 2018

@nico29 Check the options table. The default value for defaultNS is "common". Since you don’t have a namespace named "common", the server was trying to load it and failing, thus tReady was returning false.

If you don’t have a "common" namespace, you need to set your defaultNS to something else. I cloned your repo and set defaultNS to "home" and the error ceased.

Let me know if you have any further questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot have it work with with-apollo nextjs example · Issue #59
I am having a hard time making SSR work with this plugin and Apollo Client, following the official example. I created the HOC...
Read more >
Getting Started With Apollo Client in Next.js
There are benefits and tradeoffs to each strategy, but I'm happy to report that Apollo Client is compatible with all three!
Read more >
next-with-apollo, SSR does not work, request is done on client
Here is the solution I am using. It allows to wrap the page(main component) in the HOC and then make request ssr or...
Read more >
Configure Apollo Client with Next.js - Hasura
Let's get started by installing apollo client & peer graphql dependencies: ... Next let's create the HOC withApollo that we will use inside...
Read more >
Why use Next.js with Apollo - LogRocket Blog
Once again, this is a great example of how the Apollo Client helps speed up development and make us more efficient developers when...
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