Incompatibility with Leaflet

Created on 20 January 2025, 1 day ago

Problem/Motivation

"drupal/fontawesome": "2.26.0",
"drupal/geocoder": "4.26.0",
"drupal/geofield": "1.64.0",
"drupal/leaflet": "10.2.35",
"npm-asset/fontawesome-iconpicker": "3.2.0",
"npm-asset/fonticonpicker--fonticonpicker": "3.1.1",
"npm-asset/fortawesome--fontawesome-free": "6.7.1",

So latest versions of modules. And loading local library. I have "Font Awesome Method": "SVG with JS".

When I set a geofield on a content type, and on the form display I use leaflet map, on the content form I have this error:

Uncaught TypeError: Cannot read properties of undefined (reading 'setOptions')
    at e.setOptions (leaflet-geoman.min.js?v=2.13.0:1:89237)
    at leaflet-geoman.min.js?v=2.13.0:1:60579
    at Array.forEach (<anonymous>)
    at e.setGlobalOptions (leaflet-geoman.min.js?v=2.13.0:1:60541)
    at Object.update_leaflet_widget_map (leaflet.widget.js?sqeegn:169:17)
    at HTMLDivElement.<anonymous> (leaflet.widget.js?sqeegn:18:50)
    at Function.each (jquery.min.js?v=3.7.1:2:3129)
    at ce.each (jquery.min.js?v=3.7.1:2:1594)
    at Object.<anonymous> (leaflet.widget.js?sqeegn:8:34)
    at Function.each (jquery.min.js?v=3.7.1:2:3179)

And then multiple errors if I try to add a marker on the map.

In leaflet/js/leaflet-geoman-free/dist/leaflet-geoman.min.js:

...
  setOptions: function(t) {
      L.Util.setOptions(this, t)
  },
...

I set a breakpoint on this line. At the beginning it is ok, but at the 10th execution (or something like that), the L global variable is overridden by Fontawesome library JS.

See screenshots.

I don't know if there is something to do on Fontawesome module side or if it is on Leaflet module side.

Just creating the issue.

🐛 Bug report
Status

Active

Version

2.0

Component

Miscellaneous

Created by

🇫🇷France Grimreaper France 🇫🇷

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024