Select to view content in your preferred language

JavaScript error when using locally hosted ArcGIS Maps SDK CDN in a production Experience Builder application

887
12
04-16-2025 11:50 AM
kendrick123
Emerging Contributor

I am getting the following error when hosting a downloaded ExB app which uses a locally hosted CDN:

index.js:2 Action class widgets/common/table/dist/data-actions/view-in-table load failed. TypeError: Cannot read properties of null (reading 'trim')
at Module.w [as normalize] (init.js:116:221)
at k._sanitizeUrl (IdentityManager.js:35:388)
at k.findOAuthInfo (IdentityManager.js:13:222)
at nI.registerOAuthInfo (index.js:610:23023)
at nI.initToRegisterOAuthForMainPortalAndAGOL (index.js:610:22681)
at nI.<anonymous> (index.js:610:18494)
at Generator.next (<anonymous>)
at s (index.js:610:17219)

I have spent days trying to debug the problem with no success. The error happens if I have a custom widget and also the built in table widget inside the experience. The downloaded experience is hosted on IIS. The error does not happen on the first load but on a random consecutive load and after the error it keeps giving the same error.

Few observations:

  • The error does not surface when using CDN hosted in ESRI servers.
  • The error only happens if experience has a custom widget and the built in table widget.
  • Error disappears when clearing the cache.
  • Error disappears when updating service workers on reload.

So for some reason portalUrl value ends up being undefined and that's what's causing the error inside view-in-table but I have no idea why. I suppose it has something to do with caching and service workers.

As a last resort I did a fresh offline install of ExB developer edition 1.17, downloaded the JSAPI 4.32 and hosted it on IIS. In Experience Builder I created an experience, added the table widget and the sample custom widget that comes with ExB dev edition download and still the same error appears.

I hope that someone can shed some light into why is this happening.

 

0 Kudos
12 Replies
JordanCarmona
Occasional Contributor

We were in the same boat; we're testing and upgrading into 1.18 where we were unable to reproduce the issue. The lift should be fairly minimal for you since the calcite issues were introduced in 1.17; we haven't encountered any huge gotchas.

0 Kudos
JunshanLiu
Esri Contributor

Where do you host the Maps SDK? Under the same domain as the app?

0 Kudos
kendrick123
Emerging Contributor

Yes, both are hosted on the same machine on IIS.

0 Kudos