Electron local resources broken in 1.45+

We've been running Cesium 1.44.0 in Electron on Windows and I've just tried updating to the 1.46.1 release.

We load local resources (a geojson file on C: drive in this case) which no longer load probably due to the changes in PR 6454 (https://github.com/AnalyticalGraphicsInc/cesium/pull/6454).

It seems these changes work when running in node directly (tested using the cesium-webpack example), but via electron it enters loadWithHttpRequest, parses C: as the protocol and fails on the HTTP request - when it shouldn't be a HTTP request at all.

To try and provide a simple example, I pulled up the basic tutorial for running cesium in electron from the blog (https://cesium.com/blog/2016/04/04/an-introduction-to-cesium-desktop-apps-with-electron/). If you change the package.json to exactly "cesium":"1.44.0" it works. Change it to "1.45.0" and Cesium crashes immediately with an "Error: No url" message.

This might be an unrelated issue due to Ion changes so I wasn't able to proceed with loading the local geojson file. In our application running webpack, Cesium does load for 1.46.1, but fails on the Cesium.GeoJsonDataSource.load("C:\\whatever\\example.geojson") call.

Hi there,

You’ll can’t load file directly from the disk, you’ll need to serve it at some sort of web server. Cesium includes a basic development server (server.js) you could try. The reason it was working with webpack is because it is bundling that local resource and serving it up at a URL which is hidden from you.

Thanks, hope that helps,


Thanks for the bug report. I can reproduce this and I agree it was probably related to the PR you linked to. I wrote up a Ceisum issue to track this: https://github.com/AnalyticalGraphicsInc/cesium/issues/6671 We’ll update this thread when the issue is fixed.

Until its fixed, Is there any workaround for this?

I am following this tutorial: https://cesium.com/blog/2016/04/04/an-introduction-to-cesium-desktop-apps-with-electron/ with just basic HelloWorld.html file and I still get the same error

This was a regression in Cesium on my part. I just opened https://github.com/AnalyticalGraphicsInc/cesium/pull/6726 to fix the issue. Thanks for reporting it. It will go into the next official Cesium release on July 2nd.

Hello! This issue has been fixed and will be included in the Cesium 1.47 release available July 2nd.