Select to view content in your preferred language

view.popup.fetchFeatures is not a function

144
1
08-11-2024 05:33 AM
Shixian_Sheng
Occasional Contributor

I encountered an error on a custom widget which worked well for 1.13 but got an issue on 1.14. How to fix:


view.popup.fetchFeatures is not a function

0 Kudos
1 Reply
QunSun
by Esri Contributor
Esri Contributor

This is a breakchange of JS API. From JS API 4.27, The Popup widget loading is deferred until the view is ready and finished updating, and will only be loaded if View.popupEnabled is set to true (which is the default), when View.openPopup() is called, or when some widgets need the popup, such as Search.  That is to say, in API 4.26, after View is initialized, View.popup is a Popup instance, but in API 4.27, after View is initialized, View.popup is just an ordinary object. Only after calling the View.openPopup() method, View.popup will become a Popup instance. See details here - https://developers.arcgis.com/javascript/latest/breaking-changes/#427

 

I think you can call View.openPopup(), when this method is resolved, you can call view.popup.fetchFeatures().

0 Kudos