# Workers, webpack and cors

**URL:** <https://community.cesium.com/t/workers-webpack-and-cors/29238>\
**Category:** CesiumJS\
**Created:** [January 12, 2024, 1:16am UTC](https://community.cesium.com/t/workers-webpack-and-cors/29238 "2024-01-12T01:16:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [January 12, 2024, 1:16am UTC](https://community.cesium.com/t/workers-webpack-and-cors/29238/1 "2024-01-12T01:16:03Z")

</div>

We are switching to webpack 5 and latest cesium and are encountering cors errors with workers now. Apparently inline-ing workers only woks for asm automatically.  
Could somebody discuss their approach and or potentially changes to workers in new packaging?

---

<div class="post-metadata">

**Author:** ![Levi\_Montgomery](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/levi_montgomery/32/23219_2.png) [@Levi\_Montgomery](https://community.cesium.com/u/Levi_Montgomery)\
**Post date:** [April 25, 2024, 8:16pm UTC](https://community.cesium.com/t/workers-webpack-and-cors/29238/3 "2024-04-25T20:16:35Z")

</div>

I am running into the same issue, will let you know if I solve it. Looking into a dev server approach.

---

<div class="post-metadata">

**Author:** ![fa\_yang](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/fa_yang/32/23223_2.png) [@fa\_yang](https://community.cesium.com/u/fa_yang)\
**Post date:** [April 26, 2024, 5:30am UTC](https://community.cesium.com/t/workers-webpack-and-cors/29238/4 "2024-04-26T05:30:15Z")

</div>

we also find this problem in vite project.

> [@Webworker cross origin vite viteStaticCopy](https://community.cesium.com/t/webworker-cross-origin-vite-vitestaticcopy/31747):
>
> use vite project, viteStaticCopy to copy cesium statics when cross origin, other assets is ok, but the webwork goes wrong. 1.what i a encounter(Problem Description) I am developing an SDK based on Cesium within a Vite project. After using viteStaticCopy to copy all of Cesium’s static files, I encounter a problem when accessing these files from another Vite project (running on a different localhost port). While images do not trigger any cross-origin issues, web workers do face these problems. H…
