-
-
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
Gatsby example not working on build #12649
Comments
@oorestisime Your issue has been closed because it does not conform to our issue requirements. |
@oliviertassinari well at the same time as i said everything works great when not building. i am not sure sandbox would demonstrate the issues. Should i publish a repo containing the code? then it would be a matter of |
@oorestisime Yes, we consider a repository as a full reproduction test case :). |
@oorestisime Something is very wrong with your setup. The root component is mounted many times. I'm updating the gatsby example to handle this use case. But it should help with code splitting too. |
@oorestisime So, something really weird is going on. I would encourage you to focus on why the React tree is rendered 12 times when first displayed. |
I am not sure i understand what you mean, i have now c/p the gatsby-ssr, withRoot and pagecontext as in the example so my setup should be the same as in the example (i cleaned unused and weird configurations of my dependencies as well). |
@oliviertassinari when should i use the withRoot? i ve been using it in every component, every page etc. I've removed the call from the components (letting it only in the top component whether its a page or a template) and the tree doesn't get rendered as many times and everything seems to be working. |
@oliviertassinari i am bringing this back up just in case you have a few minutes to answer this question which could be really helpful for me (and others i guess messing around with material-ui and gatsby) |
Expected Behavior
Using the gatsby example during the developing phase (
gatsby develop
) and build (gastby build
) i expect to have the same styling and functionnality.Current Behavior
On develop everything works perfectly. On build everything is weird. i have different output when i refresh pages and it seems everything is messed up
Steps to Reproduce
I can't share the code right now in total. i can provide with files if needed. I used the gastby-ssr and withRoot and getPageContext of the example.
Here are screenshot of things not working:
Index page




Another page
Same page hitting a refresh
Going back to index
Refreshing index again gives first photo
How things are normally
Context
Your Environment
The text was updated successfully, but these errors were encountered: