L.esri undefined with webpack
See original GitHub issue- Browser and version:
ie: Chrome 60
- Version of Leaflet (
L.version
):
1.2.0
- Version of esri Leaflet (
L.esri.VERSION
):
2.1.1
Steps to reproduce the error:
using
"leaflet": "1.2.0",
"esri-leaflet": "2.1.1",
"webpack": "3.5.3"
This might be a followup problem after #990
esri-leaflet
does not override leaflet’s L object now but also does not create the esri
property in it.
I’ve tried to debug the initialization proccess and the esri-leaflet-debug.js
script runs without producing any error. When the app loads the L.esri is undefined though.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
I can't get esri-leaflet to work with ReactJS - Stack Overflow
I can't get esri-leaflet to work with ReactJS --> basemapLayer of undefined · If you use CDN links in the main.html, L is...
Read more >Esri JS-API 4.13, Webpack, imported classes show up undefined
We are using roughly 50 classes from different packages, but five classes show up undefined, these are the failing imports: import watchUtils ...
Read more >esri-leaflet - npm
Leaflet plugins for consuming ArcGIS Online and ArcGIS Server services.. Latest version: 3.0.9, last published: 20 days ago.
Read more >L.esri.FeatureLayer | Esri Leaflet - ArcGIS Developers
L.esri.FeatureLayer is used to visualize, style, query and edit vector geographic data hosted in ... getFeature(<String or Integer> undefined id), Layer ...
Read more >leaflet - L.esri.query - where is it? - GIS Stack Exchange
L.esri.query is undefined. Initially, I'd just been loading the v1.0 JS file: <script src=" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
in webpack, you shouldn’t be expecting our plugin to reside within Leaflet’s namespace.
https://github.com/Esri/esri-leaflet-webpack-example/blob/cf53572c1293f3c982a1524482c697284798b857/main.js#L19
@jgravois Thanks. the
var esri = require('esri-leaflet');
works. Anyway I would like to dig a bit deeper: I am using ES6 import & typescript. If I importimport * as esri from 'esri-leaflet';
the typings provided byesri-leaflet
gives me the fullL
object type withesri
property in it:This is in fact wrong because when compiled to es5 it is just the
esri
plugin object. I believe the typings may be wrong here.