Leaflet: ReferenceError: L is not defined adter upgrading to 1.3.2

Created on 17 Jul 2018  Â·  14Comments  Â·  Source: Leaflet/Leaflet

  • Leaflet version I'm using: 1.3.2
  • Browser (with version) I'm using: Chrome 67.0.3396.99
  • OS/Platform (with version) I'm using: OSX

I have a working Angular/Ionic app with leaflet map. After upgrading from 1.3.1 to 1.3.2, I got this error.

blocker bug

Most helpful comment

Hey everyone, we're working on a solution — please stay tuned! See #6239 for discussion.

All 14 comments

Huh, that's weird :/
Code looks fine here: https://unpkg.com/[email protected]/dist/leaflet-src.js
Also, https://leafletjs.com uses [email protected] and it works.

Could you create and example?
Maybe it's related to Ionic?

Hi,
Same bug with VueJs (2.x) App

I found, that MarkerCluster has the problem:

working clusters with 1.0.2: https://jsfiddle.net/petrot81/wdcrof2m/

fails with 1.3.2: https://jsfiddle.net/petrot81/zg3Lxyow/

@petrot

You are passing wrong integrity hash.
New hash for 1.3.2 is sha512-0flgjCHSUHlf04m3KVuWvgVFS9aDNe64Nb1jON/7buKd1FDIyBypqAByD8vpA5G9zwAD7jMfltDSnYGBBCPC5w==, you're probably using integrity has from older version

Can you confirm it works with new integrity hash?

@cherniavskii I've just updated the source, but the css fails.

@petrot css also needs to use proper integrity hash.

But...

Looks like the real issue is that bundlers now use pkg.module (added in #6020), and there's no window.L global assign.
I'm investigating the issue

I'm also getting "L is not defined" with 1.3.2 from npm

+1

Having the same issue L being undefined.
We had the following error on our side:

node_modules/leaflet.markercluster/dist/leaflet.markercluster-src.js 16:25 Uncaught ReferenceError: L is not defined

And after some searches, I saw the new Leaflet version on npm.
We previously had on our package.json:

"leaflet": "^1.3.1",
"leaflet.markercluster": "^1.3.0",

We fixed our version to 1.3.1 in our package.json in the meantime, since it worked as expected with that version.

We're having the same issue. Fixing to 1.3.1 and it works again.

Using from npm, the error is being thrown from Leaflet.heat which is loaded immediately afterwards.

+1

Hey everyone, we're working on a solution — please stay tuned! See #6239 for discussion.

Leaflet 1.3.3 is already available!
https://leafletjs.com/2018/07/18/leaflet-1.3.3.html

Thanks for a fast feedback!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ssured picture ssured  Â·  3Comments

arminghm picture arminghm  Â·  3Comments

jcarenza picture jcarenza  Â·  3Comments

CallMarl picture CallMarl  Â·  3Comments

timwis picture timwis  Â·  3Comments