Search Widget console errors showing up in version 4.20 of JS API

831
2
Jump to solution
09-13-2021 04:23 PM
GILBERTNG1
New Contributor II

We are currently utilizing the JS API Search widget in an application for a variety of navigations. Some of them are locators, and some of them are feature layers. We also have been using MVC pass-throughs for a few feature layers, in order to add some additional logic, such as making street intersection searches more intuitive. While upgrading from version 4.18 to 4.20 of the JS API, these errors started showing up during suggest queries, but do not cause issues outside of the Chrome console. This was not an issue with version 4.18, which we currently are using in production. 

Logger.js:7 [esri.widgets.Search.SearchViewModel] TypeError: Cannot read properties of undefined (reading 'featureResult')
at Object.e.parsePBFFeatureQuery (pbfQueryUtils.js:4)
at Object.<anonymous> (query.js:8)
at Generator.next (<anonymous>)
at x (_rollupPluginBabelHelpers.js:7)
at e (_rollupPluginBabelHelpers.js:11)

Are there any workarounds to eliminate such errors? 

1 Solution

Accepted Solutions
GILBERTNG1
New Contributor II

@Noah-Sager We found the solution today. On our custom MVC pass-throughs, I added default JSON returns for featurelayer REST queries, instead of returning blank when 0 results were found. 

View solution in original post

0 Kudos
2 Replies
Noah-Sager
Esri Regular Contributor

Hi @GILBERTNG1, thanks for posting your question here. It's difficult to say what the issue is, or what a workaround could be, just based on that error message. Would you be able to share a link to a simple, reproducible test-app (or just share the code) that shows this console error?

0 Kudos
GILBERTNG1
New Contributor II

@Noah-Sager We found the solution today. On our custom MVC pass-throughs, I added default JSON returns for featurelayer REST queries, instead of returning blank when 0 results were found. 

0 Kudos