Skip to content

Prerender every provider's demo pages - #77

Merged
wf9a5m75 merged 1 commit into
developfrom
fix/prerender-all-providers
Nov 13, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
fix/prerender-all-providers

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

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() in examples/basic/src/entry-server.tsx kept 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.tsx now exports MAP_PROVIDERS, and MapProvider is derived from it. getStaticPaths() maps that list through providerPath(), so a new provider is prerendered without touching entry-server.tsx.

Checked

  • Production build served locally with the same fallback as firebase.json:
    • no #418 on the /map/en page of maplibre, google-maps, mapbox, here, tomtom, maptiler, longdo, mappls and deckgl;
    • also clean on tomtom/marker/en, maptiler/polygon/ja, longdo/circle/en, mappls/polyline/en and deckgl/marker/de.
  • The live site logs #418 on every one of those pages for the five providers.
  • 4,188 prerendered paths, 313 MB dist; tsc --noEmit passes.

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.

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.
@wf9a5m75
wf9a5m75 merged commit b9fb3a1 into develop Nov 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant