v1.42 root directory problem win minified version


I was really looking forward to testing the CPU-gentle v1.42, but my app immediately failed.

To make the longish story short, I ended up having to define

window.CESIUM_BASE_URL = ‘//Cesium/’;

Cesium is loaded with an absolute path from a PHP script in another dir, which is probably the cause of the problem. Strangely, the unminified version worked fine. The hint to resolving the problem in my case came after using the Skalman uglifying/minifying routine “manually”, which produced some ugly errors in the debug console.

I have not dug into the changes from 1.41 to 1.42 that produced this problem, and although my solution is probably robust, the root cause should probably be looked at.


Hi Kjell,

We did a major refactor of how we handle resource loading throughout the Cesium code base (#6035), which makes the API a lot cleaner. Since you need to set CESIUM_BASE_URL, I expect some changes to buildModuleUrl may have required you to now set this variable. Could you be more specific about what error you were getting using the minified version so we can see if it’s something that needs cleanup?



Hi Gabby,
Sorry for not picking up your message earlier.

The problem was immediate at loading, with a semi-black window. No very helpful messages in the console (Chromium) , but here are the ones:

From the /phplib/my.php, Cesium is loaded from /jslib/Cesium/Cesium.js

The console reports

  1. /phplib/Assets/approximateTerrainHeights.json (404)

  2. /phplib/Widgets/InfoBox/InfoBoxDescription.css (net::ERR_ABORTED, position 557)

  3. /phplib/Assets/IAU2006_XYS/IAU2006_XYS_15.json (404)

  4. /phplib/Workers/transferTypedArrayTest.js (404, position 476)

  5. /phplib/Workers/cesiumWorkerBootstrapper.js (404, position 476)

  6. /phplib/ThirdParty/Workers/inflate.js (404, position 520)

As mentioned, only when minifying/uglifying the unminified Cesium.js myself did I get a hint in the console that there could be a base path issue.

Since it works fine in the unminified version (no warnings or errors), something is removed or “simplified” in the minification process. Triggered by changes in buildModuleUrl?

Best regards,


Hi Kjell,

We just fixed a bug regarding CESIUM_BASE_URL [#6231], and that fix will come out with the release on March 1st.

If you could, test with the fix. Hopefully it resolves this issue. Otherwise I’ll open a new issue in GitHub.



Hi Gabby,

If you have a precompiled minified Cesium.js v1.43, or zip you can send me I can try it quickly today ahead of release. A test of the minified version is necessary to possibly provoke the problem.


Hi Gabby, that PR looks like it just adds a trailing slash to the CESIUM_BASE_URL if it isn't specified. In this user's example they have a trailing slash in their base url already.

I am having the same issue, and also have a base url defined with a trailing slash:

window.CESIUM_BASE_URL = './assets/cesium/';

smills - True. There were various changes to the functionality of URL handling in Cesium last release, so there were a few different cleanup/bug fixes throughout.

Kjell - Apologies, I did not see this in time. The release is out if you would like to try that. (You can also build the minified version from the source if you need, see the Cesium Build Guide).