About this question
I am getting a different error and can not seem to figure it out now for a coupe of hours, Here's my code :
createMapMarkers(boatData) { console.log('DATA :'+boatData); const newMarkers = boatData.map((boat) => { return { title : boat.Name, location : { Latitude : boat.Geolocation__Latitude__s, Longitude : boat.Geolocation__Longitude__s } } }); newMarkers.unshift({ title : LABEL_YOU_ARE_HERE, icon : ICON_STANDARD_USER, location : { Latitude : this.latitude, Longitude : this.longitude } }); this.mapMarkers = newMarkers; this.isLoading = false; }I am getting this error : modules/c/boatsNearMe.js:4 Uncaught (in promise) TypeError: LWC component's u/wire target property or method threw an error during value provisioning. Original error: [e.map is not a function] at h.createMapMarkers (modules/c/boatsNearMe.js:4) at h.wiredBoatsJSON (modules/c/boatsNearMe.js:4) at b.dispatchEvent (aura_prod.js:6) at yi (/components/force/lds.js:2) at eval (/components/force/lds.js:2) at eval (/components/force/lds.js:2) I checked the piece of code by running on Here on Mozilla and it worked perfectly. It is only a throwing error in LWC.
why getting the exception “map is not a function”?