Branch deploy for #465 (the maplibre-gl 5→6 bump) has a blank map: staging.overturemaps.org/docs/pr/465-no-autogen/guides/buildings shows nothing past the background fill, vs. the working live buildings guide.
Root cause
maplibre-gl v6 ships ESM-only. Per the v5→v6 migration guide, bundler consumers must call setWorkerUrl() explicitly, since import.meta.url no longer resolves the worker chunk from inside a bundle.
The worker file (maplibre-gl-worker.mjs) also statically imports a sibling chunk, maplibre-gl-shared.mjs. Rspack's asset handling for new URL('maplibre-gl/dist/maplibre-gl-worker.mjs', import.meta.url) only emits the referenced file, not that sibling, so maplibre-gl-shared.mjs 404s. It 404s silently too: the dev server's SPA fallback serves index.html for the missing path with a text/html content type instead of a real 404, so there's nothing in the console to point at. The worker's module import then fails with an opaque error, the map never fires load/idle, and nothing past the background layer paints.
On top of that, our CI uses lowlydba/sustainable-npm with ignore-scripts defaulting to true as of v3.0.0, which skips npm's automatic pre/post lifecycle hooks (prestart/prebuild) while still running whatever's explicitly invoked by npm run. A first attempt at the fix relied on a prebuild hook to copy the worker files, so it worked locally but stayed broken on the actual staging PR preview.
Fix
See #467.
Branch deploy for #465 (the
maplibre-gl5→6 bump) has a blank map: staging.overturemaps.org/docs/pr/465-no-autogen/guides/buildings shows nothing past the background fill, vs. the working live buildings guide.Root cause
maplibre-glv6 ships ESM-only. Per the v5→v6 migration guide, bundler consumers must callsetWorkerUrl()explicitly, sinceimport.meta.urlno longer resolves the worker chunk from inside a bundle.The worker file (
maplibre-gl-worker.mjs) also statically imports a sibling chunk,maplibre-gl-shared.mjs. Rspack's asset handling fornew URL('maplibre-gl/dist/maplibre-gl-worker.mjs', import.meta.url)only emits the referenced file, not that sibling, somaplibre-gl-shared.mjs404s. It 404s silently too: the dev server's SPA fallback servesindex.htmlfor the missing path with atext/htmlcontent type instead of a real 404, so there's nothing in the console to point at. The worker's module import then fails with an opaque error, the map never firesload/idle, and nothing past thebackgroundlayer paints.On top of that, our CI uses
lowlydba/sustainable-npmwithignore-scriptsdefaulting totrueas of v3.0.0, which skips npm's automatic pre/post lifecycle hooks (prestart/prebuild) while still running whatever's explicitly invoked bynpm run. A first attempt at the fix relied on aprebuildhook to copy the worker files, so it worked locally but stayed broken on the actual staging PR preview.Fix
See #467.