Select to view content in your preferred language

Deploying Custom Widget on Portal (enterprise11.5)

243
1
03-04-2026 05:08 AM
BrankoTomasic
New Contributor

Hello,

I have developed a custom widget using ArcGIS Experience Builder Developer Edition.

The widget works correctly:

  • Locally (Developer Edition)

  • In Experience Builder Live View on the Portal

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.

0 Kudos
1 Reply
TimWestern
MVP Regular Contributor

are you using a class based widget or functional based widget?

I presume you set the map in a map widget settings before publishing right?

We might need to see a bit more code than those two methods.

My gut says its an issue with life cycle of the widget.  When you do it in live mode vs preview does it act the same or does preview also do something similar with an error?

0 Kudos