Repository navigation
Fix/markercluster leaflet import order - #504
Merged
louismaximepiton merged 1 commit intoOct 21, 2026
Merged
louismaximepiton merged 1 commit into
louismaximepiton merged 1 commit into
Conversation
✅ Deploy Preview for iotmapcomponent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The CommonJS output copies Leaflet into `L` with __importStar, so members added afterwards by leaflet.markercluster were missing and L.markerClusterGroup was not a function. Import Leaflet and the plugin before `import * as L` so the copy includes the plugin.
sebnic
force-pushed
the
fix/markercluster-leaflet-import-order
branch
from
October 19, 2026 13:42
0474cc8 to
3c9754c
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The focused import-order fix addresses plugin initialization with no blocking issues identified.
No open issues 🎉
What changed in this PR
Fixes Leaflet plugin initialization by loading markercluster before creating the CommonJS Leaflet namespace.
Changes:
- Reorders imports so markercluster extends Leaflet before
Lis imported. - Documents why the import order matters.
| File | Description |
|---|---|
| src/iotMapManager/src/iot-map-manager.ts | Reorders Leaflet imports and explains the CommonJS requirement. |
Review effort: Balanced
louismaximepiton
approved these changes
Oct 21, 2026
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.
This pull request updates the import order in
iot-map-manager.tsto ensure that Leaflet plugins extend the correct Leaflet instance. This change addresses issues with plugin initialization due to the way CommonJS handles module imports.Import order and plugin initialization:
'leaflet'and'leaflet.markercluster'are imported before importing all of Leaflet asL, ensuring plugins extend the correct Leaflet instance and preventing issues caused by module snapshotting in CommonJS.