-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: mainScriptUrlOrBlob ignored when USE_ES6_IMPORT_META is off #23769
Comments
For a bit more detail: Using a blob as the actual script means that import.meta.url is a blob, so new URL(...) can't work. Using a mainScriptBlobOrUrl is just ignored. So both of the tricks I've used in the past for cross origin workers are not available. |
Thanks Joe! We are obviously lacking some test coverage here. |
I think a reasonable fix for this is to:
|
JoeOsborn
added a commit
to JoeOsborn/emscripten
that referenced
this issue
Feb 28, 2025
Per the discussion in emscripten-core#23769, implement this policy: - If mainScriptUrlOrBlob is set, create the worker as in the old non-use-import-meta case - If import.meta.url is a blob url, use it for the worker script - Otherwise, use new URL(TARGET_JS_NAME, import.meta.url)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Per #23171 (comment)
The recent removal of USE_ES6_IMPORT_META broke a use case like this:
This used to be supported using either an importScripts() hack in the worker or by downloading the whole script as a blob, but now that's not possible since the fix in #23171 forces the use of a specific file name.
The text was updated successfully, but these errors were encountered: