Hello,
I have developed a custom widget using ArcGIS Experience Builder Developer Edition.
The widget works correctly:
However, after publishing the app and opening it in Preview, the widget no longer works. I receive the following error:
Cannot read properties of null (reading 'view')
It appears that JimuMapView is null after publishing.
Here is the relevant code where I initialize the map view:
const activeViewChangeHandler = (jmv: JimuMapView) => {
if (jmv) {
setJimuMapView(jmv)
}
}
{props.useMapWidgetIds && props.useMapWidgetIds.length === 1 && (
<JimuMapViewComponent
useMapWidgetId={props.useMapWidgetIds?.[0]}
onActiveViewChange={activeViewChangeHandler}
/>
)}
I’m unsure why JimuMapView becomes null only after publishing, while it works correctly in Live View and locally.
Has anyone experienced this behavior or knows what might cause this difference between Live and Published modes?
Thank you in advance for your help.