TypeError: Cannot read properties of undefined (reading 'length')

Created on 1 March 2024, 11 months ago
Updated 20 March 2024, 11 months ago

Problem/Motivation

If Marker HTML is not available the following error is raised:

geolocation-marker-infobubble.js?s9nxf0:86 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
    at geolocation-marker-infobubble.js?s9nxf0:86:25
    at _.Ml.<anonymous> (geolocation-api.js?v=8.x-3.x:485:13)
    at Function.each (jquery.min.js?v=3.7.0:2:3129)
    at GeolocationGoogleMap.addMarkerAddedCallback (geolocation-api.js?v=8.x-3.x:484:13)
    at geolocation-marker-infobubble.js?s9nxf0:81:15
    at geolocation-api.js?v=8.x-3.x:864:26
    at GeolocationGoogleMap.populatedCallback (geolocation-api.js?v=8.x-3.x:504:42)
    at Wn.<anonymous> (geolocation-google-maps-api.js?v=8.x-3.x:134:15)
    at Wn.<anonymous> (js?region=uk&language=en&libraries=&key=AIzaSyA1on9v2pbaqqrIM4bRtEQVOoSZAOlnMtU&callback=Drupal.geolocation.google.load:150:341)
    at _.uk (js?region=uk&language=en&libraries=&key=AIzaSyA1on9v2pbaqqrIM4bRtEQVOoSZAOlnMtU&callback=Drupal.geolocation.google.load:151:94)

Proposed resolution

Update the code if (content !== undefined && content.length < 1) {

πŸ› Bug report
Status

Fixed

Version

3.12

Component

GoogleMapsAPI

Created by

πŸ‡ΊπŸ‡¦Ukraine v.dovhaliuk

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024