Skip to main content

SSR, loading, and errors

ChileMap can render on the server with its explicit topology. Regional lazy imports are bundler-oriented; for deterministic SSR, pass a topology override:

import comunas13 from "react-chile-map/data/comunas-13.json";

<RegionComunasMap region="13" topology={comunas13} data={data} />;

Regional loading errors never need to crash the application:

<RegionProvinciasMap
region={region}
loadingFallback={<MapSkeleton />}
errorFallback={(error) => <RetryPanel message={error.message} />}
onLoadError={(error) => telemetry.capture(error)}
/>

Rejected lazy imports are removed from the internal cache, so remounting or retrying can issue a fresh request. Successful imports remain cached by region.

Development diagnostics use deduplicated console.warn messages. Production builds remain silent for the same recoverable input problems.