-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Dynamic imports don't work from inlined web worker #17825
Comments
Start a new pull request in StackBlitz Codeflow. |
After using inline, the code will be converted to base64 encoding, which leads to the relative path after compilation, which is a wrong way to get it, and I will fix this problem |
If the intent is to inline an entire worker without code-splitting, then it's possible to use |
@hi-ogawa my goal is to use dynamic imports inside the inline worker without inlining. |
@kot-lex Yeah, it's apparent that this pattern is not working and thanks for the reproduction. Btw, can you elaborate more on how it's not ideal to have neither non-inline worker nor fully-bundled inline worker with |
@hi-ogawa sure:
|
For your usecase, I'd recommend using this workaround (#13680 (comment)). |
Describe the bug
I'm using an inlined (?worker&inline) web worker that dynamically imports some other libraries.
It works well in dev mode but fails in the production build since the filenames are relative which doesn't work with the worker's blob url.
Reproduction
https://stackblitz.com/edit/vitejs-vite-2td2he?file=src%2Fworker.ts
Steps to reproduce
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: