Skip to content

TypeError: Z.markerClusterGroup is not a function  #89

@Stan92

Description

@Stan92

Hi,
I m facing a strange bug.. it perfectly work in dev env but once I build the app I get an error

my packages

    "@bluehalo/ngx-leaflet": "^18.0.2",
    "@bluehalo/ngx-leaflet-markercluster": "^18.0.1",
   "leaflet": "^1.9.4",
   "leaflet.markercluster": "^1.5.3",

The error

chunk-BIIIJQ6J.js:7 ERROR 
TypeError: Z.markerClusterGroup is not a function
    at f.ngOnInit (chunk-XPW44FIX.js:1:34715)
    at Hg (chunk-BIIIJQ6J.js:7:20147)

This the part of the code that generates the error

        ngOnInit() {
            this.leafletDirective.init();
            let t = this.leafletDirective.getMap();
            **this.markerClusterGroup = Z.markerClusterGroup(this.markerClusterOptions),**
            this.markerClusterGroup.addTo(t),
            this.setData(this.markerData),
            this.markerClusterReady.emit(this.markerClusterGroup)
        }

  <div class="min-h-80"
       leaflet
       [leafletLayers]="layers"
       [leafletOptions]="options"
       (leafletMapReady)="onMapReady($event)"
       [leafletMarkerCluster]="markerClusterData"
       [leafletMarkerClusterOptions]="markerClusterOptions"
       (leafletMarkerClusterReady)="markerClusterReady($event)"></div>

I probably missed something.. but can't figure out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions