You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
STOP generating module workers. They are not widely supported. Just generate plain workers. After all, workers don't need to be a module they can import other scripts using importScripts() even synchronously.
Support dynamic imports - build throws when importing dynamically even though it generates module workers 😒 . Rewrite dynamic imports using importScripts().
Emit asset files and other dynamically imported JS files. Right now building for production only emits the worker.js file. Stop assuming that workers don't need assets. I work with lots of binary assets and WebAssembly files.
Workarounds
Few of these issues are solvable by workarounds. For example, assets can be emitted if they are imported into the main thread code.
But many of them cannot be worked around.
I tried use importScripts() but the {type:"module"} prevents that. I have no way around it but to use webpack. 😢
I like vite. 💗
That's why I care to report.
I will be very happy if I am able to use Vite for all my projects but quirks like these make it impossible.
I like to contribute to this project but I have no free time. When I have one I will try to solve these issues.
Until then you people on the internet please try to solve 🥺 I think that they are necessary for this project.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
Support dynamic imports - build throws when importing dynamically even though it generates module workers 😒 . Rewrite dynamic imports using importScripts().
STOP generating module workers. They are not widely supported. Just generate plain workers. After all, workers don't need to be a module they can import other scripts using importScripts() even synchronously.
This is fixed in #7099 (will be released in next Vite 2.9 beta)
Emit asset files and other dynamically imported JS files. Right now building for production only emits the worker.js file. Stop assuming that workers don't need assets. I work with lots of binary assets and WebAssembly files.
Thanks for taking the time to highlight these issues, but it would be helpful to split these up next time so we can fix them up individually. And there has been past issues for the specific points.
Describe the bug
There are many issues in WebWorkers
importScripts()
even synchronously.importScripts()
.Workarounds
Few of these issues are solvable by workarounds. For example, assets can be emitted if they are imported into the main thread code.
But many of them cannot be worked around.
I tried use
importScripts()
but the{type:"module"}
prevents that. I have no way around it but to use webpack. 😢I like vite. 💗
That's why I care to report.
I will be very happy if I am able to use Vite for all my projects but quirks like these make it impossible.
I like to contribute to this project but I have no free time. When I have one I will try to solve these issues.
Until then you people on the internet please try to solve 🥺 I think that they are necessary for this project.
Reproduction
https://github.com/vigneshpa/vite-wasm-worker-bug
System Info
System: OS: Linux 5.16 Arch Linux CPU: (4) x64 Intel(R) Core(TM) i3-7020U CPU @ 2.30GHz Memory: 3.33 GB / 7.63 GB Container: Yes Shell: 5.8 - /bin/zsh Binaries: Node: 17.3.0 - /usr/bin/node npm: 8.4.0 - /usr/bin/npm Browsers: Chrome: 98.0.4758.80 Firefox: 96.0.3 npmPackages: vite: ^2.8.0 => 2.8.0
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: