Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix toLatLngBounds was not found in 'leaflet' #1343

Closed
wants to merge 1 commit into from

Conversation

fuhidev
Copy link

@fuhidev fuhidev commented Sep 28, 2022

export 'toLatLngBounds' (imported as 'latLngBounds') was not found in 'leaflet'

export 'toLatLngBounds' (imported as 'latLngBounds') was not found in 'leaflet'
@gavinr
Copy link
Contributor

gavinr commented Sep 28, 2022

Thank you for the PR!. This is a potential fix for #1342. We'll test this soon.

@pavch
Copy link

pavch commented Sep 29, 2022

waiting eagerly this fix

@gavinr
Copy link
Contributor

gavinr commented Sep 29, 2022

Hi, we are hoping that the fixes happening in leaflet (Leaflet/Leaflet#8451 / Leaflet/Leaflet#8493) will resolve this without this PR being required. If the leaflet 1.9 patch does not resolve it, we will look more into this solution in this PR. Thanks for your patience!

@pavch
Copy link

pavch commented Sep 30, 2022

Hey! What about compatibility with older versions of Leaflet?

@addy
Copy link

addy commented Oct 4, 2022

@gavinr I saw Leaflet released 1.9.1 which doesn't seem to fix the issue :\

@gavinr
Copy link
Contributor

gavinr commented Oct 4, 2022

Leaflet released v1.9.2 a few hours ago: https://github.com/Leaflet/Leaflet/releases/tag/v1.9.2

And I have tested that using 1.9.2 (instead of 1.9.0 or 1.9.1) fixes the issue #1342, so I think the solution is for anyone who wants to use leaflet v1.9 to use >=1.9.2 .... and this PR can be closed without merging. I will close this soon unless I hear any major objections.

Thanks!

@gavinr
Copy link
Contributor

gavinr commented Oct 7, 2022

I am assuming this is resolved if using leaflet v1.9.2 (#1342 (comment)). If not, please comment or open a new issue. Thank you!

@gavinr gavinr closed this Oct 7, 2022
@mbostock
Copy link

This still seems to be broken. Here is a simple reproduction using jsDelivr’s +esm service:

import("https://cdn.jsdelivr.net/npm/esri-leaflet/+esm")

This generates an error:

SyntaxError: The requested module '/npm/leaflet@1.9.4/+esm' does not provide an export named 'toLatLngBounds'

@gavinr
Copy link
Contributor

gavinr commented Jan 23, 2024

@mbostock thanks for digging up this issue to report this item. I did a bit of research here:

I do not get this error when installing via NPM and using the ES modules that way, for example here: https://github.com/gavinr-maps/esri-leaflet-react-demo. Is that the same for you?

So then the issue is when using ES modules via <script type="module" with these common CDNs (e.g. Skypack, esm.sh, or jsdeliver.net.../+esm). I can confirm that I am getting the same error as you when using those. Replication cases:

So I do think this is a slightly different (but similar) issue than the original issue here... It would probably be good to open a new issue, focusing on the error when using ESM url CDNs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants