From 3c9754c23f267547abbaac15c1ddf84f2df49c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nicaisse?= Date: Mon, 19 Oct 2026 15:40:30 +0200 Subject: [PATCH] fix: load leaflet plugins before snapshotting Leaflet in the manager 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. --- src/iotMapManager/src/iot-map-manager.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/iotMapManager/src/iot-map-manager.ts b/src/iotMapManager/src/iot-map-manager.ts index f3b7a08f..38d19d72 100644 --- a/src/iotMapManager/src/iot-map-manager.ts +++ b/src/iotMapManager/src/iot-map-manager.ts @@ -10,8 +10,10 @@ * Software description: web library for interactive maps providing Orange branded reusable markers, tabs, clusters and paths */ -import * as L from 'leaflet' +// Order matters: the CommonJS output snapshots Leaflet in `L` (__importStar), so plugins must extend Leaflet before that import. +import 'leaflet' import 'leaflet.markercluster' +import * as L from 'leaflet' import { IotMapConfig } from './iot-map-config' import { IotMapDisplay } from './iot-map-types' import { getAutomaticClusterIcon } from './iot-map-icons'