Fix build: maplibre-gl 6 has no default export - #289
Merged
IgnaceMaes merged 1 commit intoJul 25, 2026
Merged
Conversation
maplibre-gl@6.0.0 ships a pure-ESM build that exports only named
bindings, so `import maplibregl from 'maplibre-gl'` now fails the app
build with:
[MISSING_EXPORT] "default" is not exported by
".../maplibre-gl@6.0.0/dist/maplibre-gl.mjs"
╭─[ app/components/map.gjs:3:8 ]
This broke every channel (release, beta and alpha) of the nightly build
starting with the 2026-07-22 run.
Switch the `<Map>` component to a namespace import, which is what
MapLibre's own documentation now recommends, and which keeps working on
maplibre-gl 5 as well. The rest of the chapter is unchanged: the
`maplibregl.Map` / `maplibregl.Marker` usage reads exactly the same.
Verified against the published output app (ember-learn/super-rentals) with
maplibre-gl 6.0.0 installed: `pnpm test` goes from a build failure to
25/25 passing, and the map still renders with its marker in the browser.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
|
Ty mr agent! |
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.
The nightly build has been red on all three channels (release, beta, alpha) since the 2026-07-22 run — the last green one was 2026-07-21.
Cause
maplibre-gl@6.0.0was published in that window. It ships a pure-ESM build (dist/maplibre-gl.mjs,"type": "module") that exports only named bindings — the default export that v5 provided is gone. Chapter 7 doesimport maplibregl from 'maplibre-gl', so the app build fails:(release fails at the same line, as do beta and alpha.)
Fix
Use a namespace import in the three places chapter 7 shows the import line:
This is what MapLibre's own README now recommends, and it keeps working on maplibre-gl 5, so the tutorial isn't pinned to a single major. Everything downstream in the chapter is untouched —
new maplibregl.Map(...)andnew maplibregl.Marker()read exactly the same, so the prose still holds. I added one sentence explaining the* asform, since the tutorial walks through each import.Verification
The full generator run needs a couple of things my machine doesn't have (
tree, and the dev-server readiness handshake didn't settle locally), so I verified against the published output app, ember-learn/super-rentals, which is the exact code this chapter generates:maplibre-gl@6.0.0into it and ranpnpm test→ reproduced the identicalMISSING_EXPORTbuild failure.pnpm testpasses 25/25, including the fourIntegration | Component | maptests.🤖 Generated with Claude Code