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.

Javascript errors with leaflet 1.1.0

See original GitHub issue
  • I’m reporting a bug, not asking for help
  • I’ve looked at the documentation to make sure the behaviour is documented and expected
  • I’m sure this is a Leaflet Draw code issue, not an issue with my own code nor with the framework I’m using (Cordova, Ionic, Angular, React…)
  • I’ve searched through the issues to make sure it’s not yet reported

How to reproduce

  • Leaflet version I’m using: 1.1.0
  • Leaflet Draw version I’m using: 0.4.9

What behaviour I’m expecting and which behaviour I’m seeing

I expect the javascript to load without throwing errors but it reports:

TypeError: can't define property "segmentsIntersect": Object is not extensible

Minimal example reproducing the issue

Load https://jsfiddle.net/1fuq748y/1/ while watching the console.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:41
  • Comments:43 (9 by maintainers)

github_iconTop GitHub Comments

10reactions
JonForestcommented, Jun 28, 2017

For a workaround on the “segmentsIntersect” bug you can pin the Leaflet version in your own package.json at “1.0.3”. This will satisfy the semver requirements of the Leaflet-draw package.json and work. Not sure what changed in the Leaflet package between 1.0.3 and 1.1.0. Might go have a quick look and see, but from a quick glance earlier, it seems the answer was ‘a lot’.

4reactions
ddproxycommented, Jun 30, 2017

Lots of good information here. It does appear the minor release of Leaflet broke Draw.

Any patches to resolve the utility issue should reference #5589 (thanks @frehner for pointing that out).

ES6 Rollup would be nice, we can set up an ES6 branch to handle that. Leaflet.Editable is having a similar issue (looks like utility) and the next ‘major’ update to Leaflet.Draw will be piggybacking off Editable - just an FYI.

In the meantime, I’ll scope the compatibility of Leaflet.Draw to a ceiling of Leaflet 1.0.x. This will happen tomorrow morning.

Read more comments on GitHub >

github_iconTop Results From Across the Web

85 - Stack Overflow
How to fix error "Failed to compile : ./node_modules/@react-leaflet/core/esm/path.js 10:41 Module parse failed: Unexpected token (10:41)" · 1.
Read more >
CRAN - Package leaflet
Create and customize interactive maps using the 'Leaflet' JavaScript library and the 'htmlwidgets' package. These maps can be used directly ...
Read more >
Leaflet v1.3.1 and newer 1.x version not recognized - Drupal
library recognition is only working fine with 1.1.0 once I copied all files from leaflet/dist/ to leaflet folder, but map is not working ......
Read more >
Download - Leaflet - a JavaScript library for interactive maps
leaflet -src.js - This is the readable, unminified Leaflet JavaScript, which is sometimes helpful for debugging. (integrity=”sha256- ...
Read more >
Leaflet.markercluster | Marker Clustering plugin for Leaflet
Include the plugin CSS and JS files on your page after Leaflet files, ... Use unpkg CDN: https://unpkg.com/leaflet.markercluster@1.1.0/dist/ ...
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