Select to view content in your preferred language

Deploying Custom Widget on Portal (enterprise11.5)

327
1
03-05-2026 03:05 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. I noticed that my activeViewChangeHandler does not tirgger which is why its null.

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
JeffreyThompson2
MVP Frequent Contributor

Check that you have jimu-arcgis listed as a dependency in manifest.json, like this example.

{
  "name": "basicMapWidget",
  "label": "Basic Map Widget",
  "type": "widget",
  "version": "1.12.0",
  "dependency": [ "jimu-arcgis" ],
  "exbVersion": "1.12.0",
  "author": "Jeffrey Thompson",
  "description": "Base for widget that need to connect to a map",
  "copyright": "City of Arlington",
  "license": "http://www.apache.org/licenses/LICENSE-2.0",
  "properties": {},
  "translatedLocales": [
    "en"
  ],
  "defaultSize": {
    "width": 800,
    "height": 500
  }
}
GIS Developer
City of Arlington, Texas