Error 404 trying local development

Hello, new member here trying to develop features to integrate with forio epicenter platform.

Problem: Error 404 Failed to load resource (jquery)

Replication:

Followed the instruction on https://forio.com/epicenter/docs/public/how_to/self_hosting/

I downloaded my project and added the necessary fields in window.FLOW_CONFIG file. Then, searched for relative links, and found just one which i changed. Serving the site locally, i show the yellow error note with unknown error and a long notation. Trying to debug this on DevTools i see some errors with the first one being “404 failed…” on a jquery call. I can see the line that may be responsible which is on jquery.js:9536 line: xhr.send( options.hasContent && options.data || null ); but i have no more knowledge what to do.

Also i get more errors like "Refused to get unsafe header “Location” " from webcomponents but i don’t know which one is the main cause.

Thanks,
Stelios

Hi Stelios,

What’s the actual file that can’t be retrieved and is returning 404?

Go to dev tools. If you click “Network” then refresh the page, look to see which calls have a 404 status code. Right click on the call, and say “Copy URL” to see the full URL.

Hi again @wglass,

Following your instructions i can see this cUrl on the header: "http://127.0.0.1:5500/epicenter/v2/config".

I guess the config part takes place on the window.FLOW_CONFIG item, as followed from the docs is:
> window.FLOW_CONFIG = {

        channel: {
          run: {
            // the model field should already be present
            model: "Atmospheric_Bathtub.vmfx",
            // add the account, project, and server fields
            account: "stelioslagaras",
            project: "atmospheric-bathtub",
            server: { host: "api.forio.com" },
          },
        },
      };

Hi,

We’ve had a chance to do further research on this, and were able to figure out how to host this locally. The article on our site is out of date but will be updated shortly. (We’re in the process of updating the instructions).

There’s a couple changes you must make.

(1) Modern browsers no longer allow dynamic applications like a Forio simulation be hosted by double clicking the file in the file system. (You’ll see CORS errors, which are security-related). You may still however host the files on your own server.

(2) Make sure all system javascript libraries are loaded from forio.com. Specifically, make sure the script tag loading run-compare.js this line in index.html starts with https://forio.com

<script charset="utf-8" src="https://forio.com/epicenter/builder/project-files-v1/run-compare.js"></script>

(3) For run comparison simulations, you must also specify the account, project, and server for other “managers” used internally by the javascript. The following block will work.

var accountName = "stelioslagaras";
var projectName = "atmospheric-bathtub";
window.FLOW_CONFIG = {
    channel: {
        defaults: {
            account: accountName,
            project: projectName,
            server: {
                host: 'api.forio.com'
            },
        },
        runManager: {
            run: {
                account: accountName,
                project: projectName,
                server: {
                    host: 'api.forio.com'
                }
            },
        },
        scenarioManager: {
            run: {
                account: accountName,
                project: projectName,
                server: {
                    host: 'api.forio.com'
                }
            },
        }
    }
};

If you make these changes, you can host “run comparison” simulations on your own server.