question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Featuregrid imports `toLatLngBounds` which leaflet exports as `latLngBounds`.

See original GitHub issue

Describe the bug

In the latest version of esri-leaflet, FeatureGrid.js imports toLatLngBounds from leaflet, which is not exported by leaflet 1.6.0. It is exported as latLngBounds. This results in an error in our rollup build. See the following logs:

[!] Error: 'toLatLngBounds' is not exported by node_modules/leaflet/dist/leaflet-src.esm.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
node_modules/esri-leaflet/src/Layers/FeatureLayer/FeatureGrid.js (3:2)
1: import {
2:   LatLngBounds,
3:   toLatLngBounds as latLngBounds,
     ^
4:   Layer,
5:   Browser,
Error: 'toLatLngBounds' is not exported by node_modules/leaflet/dist/leaflet-src.esm.js

We temporarly fixed it with an automatic replacement of the codeline after the installation of the npm modules.

Expected behavior

I expect the FeatureGrid.js to import latLngBounds instead of toLatLngBounds. You can see the export of toLatLngBounds as latLngBounds in the leaflet repository.

Environment Information

  • Version of Leaflet (1.6.0):
  • Version of Esri Leaflet (2.4.0):
  • Your OS: [macOS]
  • Browser and Version (error occurs on build time)

Additional context

We are working on an angular component library which is bundled by rollup and built by bazel.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gavinrcommented, Sep 30, 2022

@nisarmd If you’ve just started seeing it, I think your issue is probably the same as in this thread: https://github.com/Esri/esri-leaflet/issues/1342#issuecomment-1255277662

0reactions
nisarmdcommented, Sep 30, 2022

@jwasilgeo Started seeing this issue with the following versions -

Log - node_modules/esri-leaflet/src/Layer/FeatureLayer/FeatureGrid.js - Error: export ‘toLatLngBounds’ (imported as ‘latLngBounds’) was found in ‘leaflet’

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - a JavaScript library for interactive maps
All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above...
Read more >
How to use the leaflet.LatLng function in leaflet - Snyk
export const toLatLngBounds = function(arrayBounds) { if ... const northEast = new LatLng(arrayBounds[3], arrayBounds[2]) return new LatLngBounds(southWest, ...
Read more >
Bounds is not valid - angular - Stack Overflow
I'm trying to implement a leaflet map where the zoom level dynamically ... import { Component, Input, OnChanges } from '@angular/core'; ...
Read more >
types/leaflet/index.d.ts - UNPKG
The CDN for @types/leaflet. ... 14, export as namespace L;. 15. 16, import * as geojson from 'geojson'; ... 169, export class LatLngBounds...
Read more >
Fixed Bounds | Vue Leaflet
Marker is placed at 47.41322, -1.219482, bounds are { "_southWest": { "lat": ... import { LMap, LTileLayer, LMarker } from "vue2-leaflet"; export default ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found