-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
remotion-dev/remotion
#5302Closed
Copy link
Description
Description
When code using threads is compiled with Emscripten and then bundled with Vite it does not bundle and throws the following Vite error:
[vite:worker-import-meta-url] Vite is unable to parse the worker options as the value is not static.To ignore this error, please use /* @vite-ignore */ in the worker options.
file
Vite has required static worker options for some time, over 2 years. Recent changes to Emscripten have made output code incompatible with the Vite bundler.
Version of emscripten/emsdk:
Affects versions >= v3.1.58
Reproduction:
I have created a repository at https://github.com/jamsinclair/emscripten-worker-options-vite-reproduction which show cases the problem.
Potential Remedy:
Refactor library_pthread.js to use static values for the worker options. It'll be more verbose, but, it'll make the code compatible with Vite and maintain compatibility with other bundlers.
x0YYYY0, dr-matt, tomoino and mmomtchev
Metadata
Metadata
Assignees
Labels
No labels