Uncaught Error: Invalid LatLng object: (NaN, NaN)

Created on 24 July 2025, 3 days ago

After updating to D10.4.5 and "drupal/leaflet": "^10.2" (currently using leaflet 10.3.5) - clicking on a marker point to open a popup generates a JS error:

Uncaught Error: Invalid LatLng object: (NaN, NaN)
    at new v (LatLng.js:32:9)
    at Object.unproject (Projection.SphericalMercator.js:35:10)
    at Object.pointToLatLng (CRS.js:41:26)
    at e.unproject (Map.js:989:27)
    at e.panInside (Map.js:538:20)
    at e._panOnFocus (Marker.js:397:7)
    at HTMLImageElement.o (DomEvent.js:108:13)

I read the previous issue related with this error says it's been fixed but using a later version I still get this error, PHP version it's 8.3.21

Does anyone experience this as well?

🐛 Bug report
Status

Active

Version

10.2

Component

Code

Created by

🇪🇸Spain praatts

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

Comments & Activities

  • Issue created by @praatts
  • 🇮🇹Italy itamair

    Moving this into Support Request, because
    - no evidence is given here that is an objective bug: just reporting that something is not working on your side doesn't mean that there is a bug, and is not helping the community to identify and solve it
    - I cannot reproduce it, and all is looking fine on my side, and on the Leaflet DEMO site here: https://www.geodemocracy.com/drupal_geofield_stack_demo/web/geoplaces-ma...
    that is now working on PHP 8.3, Drupal core 10.4.8 and Leaflet 10.3.6 ... (but this last upgrade cannot have any impact on what reported on this issue: Invalid LatLng object: (NaN, NaN))
    - anybody else reported this same issue, as a Bug, and anyway the parent Issue should still be kept as main reference on this.

    @praatts your profile looks totally new to the Drupal Community, so you should rather better inspect your Drupal instance setup and debug it ...
    Are you using composer require etc. to build your Drupal instance and additional contro modules?

Production build 0.71.5 2024