The Search Widget occassionally returns this error to Chrome console on suggest-complete. Happens on first use but works as expected afterwards. This was reported in an earlier version here.
Console message
[esri.widgets.Search.SearchViewModel] TypeError: Cannot read properties of undefined (reading 'featureResult')
at q (https://js.arcgis.com/4.25/:43:249) {stack: 'TypeError: Cannot read properties of undefine… at q (https://js.arcgis.com/4.25/:43:249)', message: 'Cannot read properties of undefined (reading 'featureResult')'}
arg1:
TypeError: Cannot read properties of undefined (reading 'featureResult')\n at a.parsePBFFeatureQuery (https://js.arcgis.com/4.25/:2160:431)\n at Module.<anonymous> (https://js.arcgis.com/4.25/:2140:466)\n at Generator.next (<anonymous>)\n at d (https://js.arcgis.com/4.25/:38:488)\n at q (https://js.arcgis.com/4.25/:43:249) {stack: 'TypeError: Cannot read properties of undefine… at q (https://js.arcgis.com/4.25/:43:249)', message: 'Cannot read properties of undefined (reading 'featureResult')'}
message:
'Cannot read properties of undefined (reading 'featureResult')'
stack:
'TypeError: Cannot read properties of undefined (reading 'featureResult')\n at a.parsePBFFeatureQuery (https://js.arcgis.com/4.25/:2160:431)\n at Module.<anonymous> (https://js.arcgis.com/4.25/:2140:466)\n at Generator.next (<anonymous>)\n at d (https://js.arcgis.com/4.25/:38:488)\n at q (https://js.arcgis.com/4.25/:43:249)'
[[Prototype]]:
Error
m._consoleWriter @ js.arcgis.com/4.25/(index):150:331
Solved! Go to Solution.
The location of the error is on line 1 below.
const queryFeatureLayer = new FeatureLayer({ params here... }
const queryObject = queryFeatureLayer.createQuery();
set the queryObject params
run query
My guess is that the server responded with zero results or did not complete the query at all.
Running the query a second time often works, so my workaround is to run again.
if(error.message.indexOf('featureResult') > -1) {
The location of the error is on line 1 below.
const queryFeatureLayer = new FeatureLayer({ params here... }
const queryObject = queryFeatureLayer.createQuery();
set the queryObject params
run query
My guess is that the server responded with zero results or did not complete the query at all.
Running the query a second time often works, so my workaround is to run again.
if(error.message.indexOf('featureResult') > -1) {