Select to view content in your preferred language

Experience Builder unable to use subfolder path in Ajax requests

759
1
05-21-2025 07:56 AM
Labels (1)
othke
by
New Contributor

Hello

When using the ArcGIS Experience Builder v1.17 with the --path option as documented in the [installation guide](https://developers.arcgis.com/experience-builder/guide/install-guide/), the client-side code fails to honor the subfolder path in Ajax requests.

 

othke_0-1747839260272.pngothke_0-1747839260272.png

 

Environment

- ArcGIS Experience Builder: v1.17
- Web Browser: Chrome

Steps to Reproduce

1. Start Experience Builder with a custom path: npm start -- --path /exb
2. Access the builder at: https://localhost:3001/exb/
3. User is redirected to: https://localhost:3001/exb/page/set-portalurl
4. The page attempts to fetch data from https://localhost:3001/signininfo (missing the /exb prefix)
5. The request fails with a 404 error

Expected Behavior

The Ajax request should be made to `https://localhost:3001/exb/signininfo`, respecting the subfolder path.

Actual Behavior

The Ajax request is made to https://localhost:3001/signininfo, ignoring the subfolder path.

Root Cause Analysis

In the client code (client\dist\site\widgets\set-portalurl\dist\runtime\widget.js), the fetchSigninInfo method constructs the URL without considering the subfolder path:

fetchSigninInfo() {
  const t = `${window.location.protocol}//${window.location.host}/signininfo`;
  return window
    .fetch(t, { cache: "no-cache" })
    .then((t) => t.json())
    .then(
      (t) => (
        this.setState({ signinInfos: t }),
        this.getDefaultPortalUrl(t).then((t) => {
          this.selectPortalUrl(t);
        }),
        t
      )
    )
    .catch((t) => (console.error(t), t));
}

 

Other widgets in the codebase appear to use a utility method ${e.urlUtils.getFixedRootPath()} to correctly retrieve the subfolder path prefix. This method should be used in the `set-portalurl` widget as well.

Impact

Users cannot run Experience Builder in a subfolder configuration, limiting deployment flexibility.

Thanks for your help

ArcGIS Experience Builder enables you to create web apps and pages without coding. This video introduces ArcGIS Experience Builder and how you can maximize its wide array of capabilities. Learn more: http://ow.ly/CK8R50FUTaP ...
1 Reply
ShanonLoughton
Esri Contributor

Bit old but for the archives:

Replacing client code (client\dist\site\widgets\set-portalurl\dist\runtime\widget.js), in the fetchSigninInfo method:

const t = `${window.location.protocol}//${window.location.host}/signininfo`;

with

const t=`${window.jimuConfig.baseUrl}signininfo`

fixes it I think. Not exhaustively tested. Note that no slash needed before signininfo.

- Shanon Loughton (Esri Australia)
ArcGIS Enterprise on AWS, Azure & Google Cloud Professional
0 Kudos