zakjan / leaflet-lasso

Lasso selection plugin for Leaflet
https://zakjan.github.io/leaflet-lasso/
MIT License
110 stars 21 forks source link

Issue with exports from the package after update to 2.2.13 #60

Open Azbesciak opened 2 months ago

Azbesciak commented 2 months ago

Hi, after updating to 2.2.13 (from 2.2.12) I see in 2/2 projects the following error

Error: export 'LassoHandler' (imported as 'LassoHandler') was not found in 'leaflet-lasso' (module has no exports)

Error: export 'FINISHED_EVENT' (imported as 'FINISHED_EVENT') was not found in 'leaflet-lasso' (module has no exports)

Error: export 'FINISHED_EVENT' (imported as 'FINISHED_EVENT') was not found in 'leaflet-lasso' (module has no exports)

In type definitions I see these are exported, but maybe some config is invalid.

zakjan commented 2 months ago

Hi @Azbesciak, thanks for reporting. Could you explore what's the actual cause and send a PR, please? I'm sorry, but my availability is limited these days.

Azbesciak commented 2 months ago

The problem was introduced in 66b76fd8. I switched back to the commit before (5bf9f8fd), replaced files in my app's node_modules and it worked fine. My app is based on webpack and angular (17, but the same in 14 based app).

I spent some time on it, tried sugestion from https://github.com/facebook/create-react-app/issues/12674 and did not work. Also a couple of other changes in files, but... no results.

As I went through the declaration it looks all fine. I am not a low level node spec, rollup is also not my domain... but maybe it is because of the file format (there is no mjs, only cjs/esm/umd), but no clue. Adding system in rollup changed nothing. Maybe it is because of es declaration?