laptop and a wrench

Bug

TypeError: Unable to read properties of undefined (reading 'forEach') when accessing features from an interceptor's query result array.

ArcGIS Maps SDK for JavaScript
Bug ID Number BUG-000168429
SubmittedJune 18, 2024
Last ModifiedDecember 6, 2024
Applies toArcGIS Maps SDK for JavaScript
Version found4.29
Operating SystemWindows OS
Operating System VersionN/A
StatusAs Designed

Additional Information

The interceptor after must handle all types of results returned by /query. In this case there is a query call to get the feature count, so there are no features in the results, as expected. The solution is to first check if there are features in the response.

Workaround

Verify if an array is returned from the interceptor's query result prior to accessing each feature from the response.

Steps to Reproduce

Bug ID: BUG-000168429

Software:

  • ArcGIS Maps SDK for JavaScript

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options