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:
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.
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
}
}