SSR: tolerate floating point imprecision #220
Open
therealfrauholle wants to merge 5 commits intomariusandra:mainfrom
Open
SSR: tolerate floating point imprecision #220therealfrauholle wants to merge 5 commits intomariusandra:mainfrom
therealfrauholle wants to merge 5 commits intomariusandra:mainfrom
Conversation
It is irritating if the width and height is unused when using custom icons for the marker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I encountered a weird bug during SSR hydration on the client. I discovered the cause to be
Math.coswithinlat2tilenot yielding the same results on the server and in my browser, a difference not bigger than floating point imprecision.It appears the issue is related to the problem described here: https://stackoverflow.com/questions/26570626/math-log2-precision-has-changed-in-chrome
Without these changes, the following mismatched diff causes the hydration error.
Note how the diff indicates that the
transitionproperty also indicates a problem (explicit vs. compact definition), but NextJS is actually able to understand that there is no issue in this case; the problem is solely caused by the arguably differenttransformvalues. This is why I believe this might be relevant for #168.I also did some dogfood while I was on it, let me know what you think! And thank you for this awesome library 🚀
Node version: 20.18.1
React version: 19.0.0
NextJS version: 15.1.6
Client browser: Chrome 132