-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[example] Should we stop using getInitialProps with next.js? #16598
Comments
https://nextjs.org/docs#automatic-prerendering @damien-monni This happens at the page level, not the _document.js level. Our demos should be good: @timneutkens I can't find this pages vs _documents.js distinction documented, maybe it's worth adding somewhere. |
Interesting, I guess it is coming from something else in my app, probably apollo. I'll check it deeper. Thank you! |
Cool, I will assume that the problem is outside of our control. Let us know how your investigation is going. It might help someone else in the futur :). |
Pretty sure it's because of Apollo indeed. |
The example provided works well thank you. I am curious if the behavior of _document could be placed in a custom server ? Similar to the generic SSR docs on material ui. |
@jmayergit I guess it would be possible? |
Probably not a good idea, in general with Next.js 9 we don't recommend people to start with a custom server and it's reserved for very advanced edge cases. |
Hey @oliviertassinari @timneutkens just a random fella here that spent almost 1 hour looking how to implement this without using Do you think we can put this in the material-ui + next.js documentation? |
@sospedra I'm not sure how we could have best answered your concern. Any specific diff suggestions? |
Sure, I'll just submit a PR ;) |
This is more a question than a issue, but I still post it here as I think this could lead to a pull request on the next.js example.
Next.js v9 is out with an automatic prerendering feature. It can only work if we don't use getInitialProps static function, but this seems to be required to render Material-UI server side. Is there a solution about it?
The text was updated successfully, but these errors were encountered: