Skip to content

Error While Trying to draw a rectangle using react-leaflet-draw with Vite "Uncaught ReferenceError: assignment to undeclared variable type" #178

@markosbahgat

Description

@markosbahgat

Hello There,
Im getting an error while trying to draw a rectangle "Uncaught ReferenceError: assignment to undeclared variable type",
All other shapes are working fine, but the rectangle is not working, when i use Vite, it throws this error, when i use webpack it's working very good

here's my code JSX code:

<FeatureGroup> <EditControl onDrawStart={_onDrawStart} position='topleft' onEdited={_onEdited} onCreated={_onCreated} onDeleted={_onDeleted} draw={{ polyline: { icon: new L.DivIcon({ iconSize: new L.Point(8, 8), className: 'leaflet-div-icon leaflet-editing-icon' }), shapeOptions: { guidelineDistance: 10, color: 'navy', weight: 3 } }, rectangle: true, circlemarker: false, circle: false, polygon: false }} /> </FeatureGroup>

Screenshot of a comment on a GitHub issue showing an image, added in the Markdown, of an Octocat smiling and raising a tentacle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions