Repository navigation
Prerender every provider's demo pages - #77
Merged
Merged
Conversation
getStaticPaths() kept its own list of providers and missed tomtom, maptiler, longdo, mappls and deckgl. Their pages had no HTML file, so the host served /index.html, which is the prerendered MapLibre page, and React failed to hydrate it (minified error #418) on every page of those five providers. The paths now come from MAP_PROVIDERS in appRouting.tsx, the list MapProvider is defined from, so a new provider is prerendered without touching entry-server.tsx.
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.
Every page of the TomTom, MapTiler, Longdo, Mappls and deck.gl demos logs minified React error #418 (hydration mismatch, text) on demo-react.mapconductor.com.
Cause.
getStaticPaths()inexamples/basic/src/entry-server.tsxkept its own hand-written list of providers, which stopped at google-maps-3d. The five newer providers got no prerendered HTML, so Firebase's rewrite served/index.html, the prerendered MapLibre page. The client then rendered TomTom and so on over MapLibre's text (title, description, code sample) and React rejected the hydration.Fix.
appRouting.tsxnow exportsMAP_PROVIDERS, andMapProvideris derived from it.getStaticPaths()maps that list throughproviderPath(), so a new provider is prerendered without touchingentry-server.tsx.Checked
firebase.json:/map/enpage of maplibre, google-maps, mapbox, here, tomtom, maptiler, longdo, mappls and deckgl;tsc --noEmitpasses.Not changed. Every
/<provider>/hello-map/*path logs " must not be used on the initial render in a " during the build. The old list produced this too.