mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 08:00:06 +00:00
fix(client): five loads that catch their own error recover from a deploy too
The PDF export on desktop and phone, the language switch, the holiday regions and the PDF's map image load a chunk on demand and catch the failure themselves. After a deploy the old page asks for chunk names the new build no longer has, so they showed their own error on every retry (or, for the language, silently stayed in the old one) instead of reloading onto the new build the way an uncaught chunk error does. importChunk reloads once for a missing chunk and still hands the caller its error.
This commit is contained in:
@@ -2,6 +2,7 @@ import { buildRouteOverlay, wrapSvg } from './tripMapSvg'
|
||||
import { hasWebGL } from '../../utils/webgl'
|
||||
import { normalizeStyleForProvider } from '../Map/glProviders'
|
||||
import type { TripOverviewDay } from '../Map/tripRouteGeometry'
|
||||
import { importChunk } from '../../utils/chunkReload'
|
||||
|
||||
/**
|
||||
* The trip's route over a real basemap, for the PDF (#1736).
|
||||
@@ -46,7 +47,7 @@ export async function renderTripMapImage(
|
||||
let container: HTMLDivElement | null = null
|
||||
let map: { remove: () => void } | null = null
|
||||
try {
|
||||
const gl = (await import('../Map/engines/maplibre')).default
|
||||
const gl = (await importChunk(() => import('../Map/engines/maplibre'))).default
|
||||
|
||||
container = document.createElement('div')
|
||||
// Off-screen rather than hidden: MapLibre needs a laid-out box with real
|
||||
|
||||
Reference in New Issue
Block a user