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
Element ref behavior differs in development and production for initial render with new CSS support #10163
Comments
Haha! I was literally just going to create this issue! Here are two sandbox links to show the reproducible issue. |
I experience these same breaking changes when toggling between 9.1.7 to 9.2.0. Server-side refs seem to be absent in dev. |
@JarrodMFlesch it looks like the reproduction you showed is due to the new CSS support since in development when the page is first loaded we add a Disabling experimental css with |
This should be resolved with #10164 and available in Next.js >= |
You guys rock. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
After updating to next@9.2 it seems that the refs are not being created during server-side render in development mode. Everything works fine after building to production, also everything works fine when mounting that component client-side. Also, everything works fine pre 9.2. Disclaimer: I may be wrong with my conclusion of what is really the cause of the bug. It may as well be with how I am rendering those components.
To Reproduce
My code: (this is yet to be refactored to hooks).
Expected behavior
Refs should be created during server-side render in dev mode.
Screenshots
What's happening during server-side render. The elements with month names and year should be already rendered. They render only in production or during client-side mounting or after firing the resize function as you can see on the gif.
System information
The text was updated successfully, but these errors were encountered: