bluehalo / ngx-leaflet-markercluster

MIT License
61 stars 24 forks source link

Error: export 'markerClusterGroup' (imported as 'L') was not found in 'leaflet' #69

Closed remusmp closed 2 years ago

remusmp commented 2 years ago

Hello,

I'm getting a weird error starting today in my Angular project. Things worked fine for quite many months but starting today my CI cannot build the project anymore and then doing a clean build on my local machine also fails with the following error:

./node_modules/@asymmetrik/ngx-leaflet-markercluster/fesm2020/asymmetrik-ngx-leaflet-markercluster.mjs:20:32-52 - Error: export 'markerClusterGroup' (imported as 'L') was not found in 'leaflet' (possible exports: Bounds, Browser, CRS, Canvas, Circle, CircleMarker, Class, Control, DivIcon, DivOverlay, DomEvent, DomUtil, Draggable, Evented, FeatureGroup, GeoJSON, GridLayer, Handler, Icon, ImageOverlay, LatLng, LatLngBounds, Layer, LayerGroup, LineUtil, Map, Marker, Mixin, Path, Point, PolyUtil, Polygon, Polyline, Popup, PosAnimation, Projection, Rectangle, Renderer, SVG, SVGOverlay, TileLayer, Tooltip, Transformation, Util, VideoOverlay, bind, bounds, canvas, circle, circleMarker, control, default, divIcon, extend, featureGroup, geoJSON, geoJson, gridLayer, icon, imageOverlay, latLng, latLngBounds, layerGroup, map, marker, noConflict, point, polygon, polyline, popup, rectangle, setOptions, stamp, svg, svgOverlay, tileLayer, tooltip, transformation, version, videoOverlay)

Here is my package.json file:

{
  "name": "app",
  "version": "1.10.3",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~14.2.3",
    "@angular/cdk": "^14.2.2",
    "@angular/common": "~14.2.3",
    "@angular/compiler": "~14.2.3",
    "@angular/core": "~14.2.3",
    "@angular/forms": "~14.2.3",
    "@angular/localize": "^14.2.3",
    "@angular/platform-browser": "~14.2.3",
    "@angular/platform-browser-dynamic": "~14.2.3",
    "@angular/router": "~14.2.3",
    "@asymmetrik/ngx-leaflet": "^14.0.1",
    "@asymmetrik/ngx-leaflet-markercluster": "^14.0.1",
    "@ng-bootstrap/ng-bootstrap": "^13.0.0",
    "@popperjs/core": "^2.11.6",
    "@stripe/stripe-js": "^1.37.0",
    "@tinymce/tinymce-angular": "^7.0.0",
    "@types/leaflet": "^1.8.0",
    "@types/leaflet.markercluster": "^1.5.1",
    "bootstrap": "^5.2.1",
    "d3": "^7.6.1",
    "file-saver-es": "^2.0.5",
    "font-awesome": "^4.7.0",
    "leaflet": "^1.9.0",
    "leaflet.markercluster": "^1.5.3",
    "ngx-stripe": "^14.1.0",
    "rxjs": "~7.5.6",
    "socket.io-client": "^4.5.2",
    "tinymce": "^6.2.0",
    "tslib": "^2.4.0",
    "zone.js": "~0.11.8"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~14.2.3",
    "@angular/cli": "~14.2.3",
    "@angular/compiler-cli": "~14.2.3",
    "@angular/language-service": "~14.2.3",
    "@types/jasmine": "~4.3.0",
    "@types/jasminewd2": "~2.0.10",
    "@types/node": "^18.7.18",
    "codelyzer": "^6.0.2",
    "jasmine-core": "~4.4.0",
    "jasmine-spec-reporter": "~7.0.0",
    "karma": "~6.4.1",
    "karma-chrome-launcher": "~3.1.1",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "^2.0.0",
    "protractor": "~7.0.0",
    "ts-node": "~10.9.1",
    "eslint": "~8.23.1",
    "typescript": "~4.8.3"
  }
}

Do you know what could trigger the above error? I'm just launching ng build and get that error. Many thanks!

remusmp commented 2 years ago

I've just noticed leaflet released a new version 3 days ago, i.e. 1.9.0 and things break because of it. Locking version to ~1.8.0 in package.json solves my build issues.