fix: repair gauche wasm visualization by pinning maplibre-gl - #47
Merged
Conversation
The served `gauche-wasm-map.html` loaded MapLibre GL JS from unpkg with a floating `@latest` version. MapLibre v6 dropped the UMD build entirely: it is now ESM-only, so `dist/maplibre-gl.js` returns HTTP 404. The script tag failed to load, the `maplibregl` global was never defined, and the page died with `Uncaught ReferenceError: maplibregl is not defined`. Overwrite the flat file with the freshly generated artifact from gauche-rs, which pins maplibre-gl to 5.24.0 (last release shipping UMD). The embedded wasm blob also advances: the copy served until now predated gauche-rs 459f467, so it exported only classify_point_wasm and initialize_index_wasm. The new build additionally exports classify_line_wasm and classify_bbox_wasm, which this page does not use. Verified end-to-end in a browser: basemap renders, the module reports ready, central England classifies as left-hand traffic and France as right-hand traffic. Upstream fix: Project-OSRM/gauche-rs#4 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P17bfPsp1pf8qQq8bTL9Rs
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.
Companion to Project-OSRM/gauche-rs#4. Deploys the fix for the live gauche visualization.
Problem
The hosted
gauche-wasm-map.htmlis broken — blank page, console shows:Root cause
The page loaded MapLibre GL JS from unpkg with a floating version:
MapLibre GL JS v6 dropped the UMD build.
@latestnow resolves to6.6.0, wheredist/maplibre-gl.jsreturns 404 — v6 is ESM-only (exportsprovides onlyimport→dist/maplibre-gl.mjs, nomain/browserfields).So the script tag 404s, the
maplibreglglobal is never created, andnew maplibregl.Map(...)throws. Nothing here changed — the page broke the moment MapLibre published v6.The WebAssembly is not at fault. Verified independently: the embedded module instantiates with zero imports and classifies correctly.
Change
This is a flat file copied from
gauche-rs. Overwritten wholesale with the freshly generated artifact from Project-OSRM/gauche-rs#4, which pins both the JS and CSS to5.24.0(last release shipping the UMD build).Byte-identical to
dist/gauche-wasm-map.htmlon that branch.Two things move in this diff
@latest→@5.24.0. This is the actual fix.459f467. It exported onlyclassify_point_wasmandinitialize_index_wasm; the new build additionally exportsclassify_line_wasmandclassify_bbox_wasm. This page uses neither, so it is inert here — noting it so the blob change in the diff is accounted for.Verification
Served this exact file over local HTTP and drove it in a browser:
typeof maplibregl→"object"; canvas renders;demotilesstyle, tiles and fonts all return 200Ready. Click to classify traffic side.52.820224, -1.601076 -> left-hand traffic(blue dot)46.939984, 1.914549 -> right-hand traffic(orange dot)Merge order
Either order works — the file here is self-contained and does not depend on gauche-rs#4 landing first. Merging gauche-rs#4 keeps the generator and this copy in sync for the next regeneration.