Closed moxizhou closed 1 year ago
This is in third-party code (requirejs) but after a quick look at the code, I'm pretty sure this code is never used in Cesium, so you could try commenting it out or removing it.
When I ran cesium, it did go through the line mentioned above, but this was a while ago. I did not know this was third-party code though, so there is no way to remove it on cesium end?
I don't think this is something we plan on changing at the moment, this is just part of how RequireJS works.
I would recommend adding an exception to allow this use eval when running CesiumJS.
Is it possible that use of eval
will be eliminated by https://github.com/CesiumGS/cesium/issues/9473 ?
@candrews Not as a side effect. The main problem here is that (at least last time I looked) Web Workers do not support loading ES6 modules directly and you need to use an old school browser module system (like amd/requirejs) which is why this code exists. However it's probably worth looking into if that has a better alternative now. I'll add a note to the linked issue for us to take a look. Thanks for the reminder!
Has there been any update on this issue? We are trying to use Cesium in our application but we are required to not include 'unsafe-eval' in our CSP. Simply having Cesium load in through webpack runs into this issue.
@alexfrigault No updates yet. We are potentially taking a look at eliminating requireJS and therefore eval
as a part of some modernization efforts in the near future.
@ggetz any updates on this one? :)
@pixelschubs Not yet. I would recommend keeping an eye on https://github.com/CesiumGS/cesium/issues/9473. We'll post any updates there.
@ggetz are there any updates on this Issue? Issue https://github.com/CesiumGS/cesium/issues/9473 is closed and I don't found any helpful things there.
I'm using the packages "@cesium/engine": "^2.2.0" and "@cesium/widgets": "^2.1.1"
Hi, the most recent blocker for replacing requireJS in our packaged web workers was that Firefox did not support ESM modules in workers. The good news is that issue was recently marked as resolved!
I'll re-open this issue to track updating our build system to remove RequireJS.
We are using CSP headers and ran into an issue using this library because of the use of unsafe eval.
https://github.com/CesiumGS/cesium/blob/2fd0e8f7e4212bd1e7084299187f70597a6bbfd8/Source/Workers/cesiumWorkerBootstrapper.js#L2285
I am wondering if there is an alternative for this?