Select to view content in your preferred language

Experience Builder unable to use subfolder path in Ajax requests

169
0
4 weeks ago
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.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

0 Replies