title: Esri Map in Angular page click no longer loading to lat long? 'toJSON' of null at Object.b.locationToAddress
body: <p>Currently getting an error when you click on the esri map. This function used to work. It is occuring at the locatorTask.locationToAddress(event.mapPoint).then(function (response) {</p>
  <p>The error looks like this in the console:
  <a href="https://i.stack.imgur.com/yjBpk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yjBpk.png" alt="enter image description here" /></a></p>
  <p>Here this code:</p>
  <pre><code>  mapView.when(function () {
    mapView.popup.autoOpenEnabled = false;
    mapView.on(&quot;click&quot;, function (event) {
      searchWidget.clear();
      mapView.popup.clear();
      locatorTask
        .locationToAddress(event.mapPoint)
        .then(function (response) {
          // If an address is successfully found, show it in the popup's content
          mapView.popup.content = response.address;
          var address = response.address;
          showPopup(address, event.mapPoint);
        })
        .catch(function (error) {
          // If the promise fails and no result is found, show a generic message
          mapView.popup.content = &quot;No address was found for this location&quot;;
          showPopup(&quot;No address found.&quot;, event.mapPoint);
        });
  
      mapView.popup.visible = true;
    });
  })
  </code></pre>
  <p>Thanks for any advice or help!</p>