[SOLVED] Getting "Uncaught ReferenceError: loadModules is not defined" on exported project

Hi there,

Today I’m getting this error: Uncaught ReferenceError: loadModules is not defined start.js:214
on an exported project.

To simplify the update / deployment, I have my html pages in the root directory. All the content of the downloaded zip goes in a pcdata directory, and I use <base href='pcdata/'> to correct the paths.
I have always used it in this way without problems.

If I load the base html included in the zip (adding pcdata/ to the URL in the browser) it loads correctly.

The only meaningful change I have made from the last working version (this morning) is that I have added Ammo.js to the project.

Maybe the base href is not the correct way to do it?

Thanks! Any help would be really appreciated

1 Like

Not sure what your deployment folder is like but the function/object loadModules is defined in __modules__.jswhich is included in the HTML body:

So somehow in your deployment, that is missing or the path is wrong.

1 Like

Yes! This is the problem. I have added modules.js and now it is working.

I am taking a look to the last version that was working without it, and the index.html included in the zip doesn’t have this line, so I suppose it is something that the build system adds when you need it (i.e. when you add ammo.js).

Tomorrow I’ll try to find some time to post how I deal with updates, maybe it can be userful for someone.

Thank you very much @yaustar !

1 Like