-
Notifications
You must be signed in to change notification settings - Fork 79
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
Console warnings when using SSR #260
Comments
Hi @mledwards, would you mind putting together e repro? |
Hi @toomuchdesign, thank you for taking a look. Here's the repo: https://github.com/mledwards/react-minimal-pie-chart-example-in-next This should replicate the issue above in the console every time you refresh the index page (SSR). My best guess is that the way server side JS calculates float numbers is slightly different to the way client side JS calculates them, and after 15 decimals points it deviates. Maybe the decimal place could be capped at 15 points so both the server and the client return the same number? Not sure if this would have any adverse affects on the rendering? |
Thanks @mledwards! What browsers/OS you're experiencing this issue with? Can you reproduce consistently on different browsers? |
I assume it's an issue about how different JS engines handle float numbers. V8 seems to work consistently across Node and Chromium/Blink browsers. Not totally sure we should address this in user land, but It let's discuss possible solutions/workaround. The glitch here is that non-Chromium/blink users might perform and extra render loop after mount which I'd be glad to avoid. |
I'm on a Mac and can see it on Firefox and Safari, but not on Chrome and Edge. Sorry, I should have mentioned that in the original message. Maybe I'll try and suppress that Next.JS warning. |
Hello. I'm using Next.js which has server side rendering (SSR) built in (e.g. loads from the server on page refresh).
I'm getting some console warnings when the page is being SSR loaded, as the numbers are not matching between the server and the client.
Here's one of the warnings.
Does anyone know if there's a way of fixing this?
The text was updated successfully, but these errors were encountered: