Cannot have it work with with-apollo nextjs example
See original GitHub issueHello.
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:
- Created 5 years ago
- Reactions:1
- Comments:14 (9 by maintainers)
@isaachinman Thank you so much. That solved it all! Also thanks to @MathiasKandelborg and @kachkaev Merry Xmas to all 😃
@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, thustReady
was returningfalse
.If you don’t have a
"common"
namespace, you need to set yourdefaultNS
to something else. I cloned your repo and setdefaultNS
to"home"
and the error ceased.Let me know if you have any further questions.