-
Notifications
You must be signed in to change notification settings - Fork 326
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
🐛 BUG: Uncaught error when initializing two top level WASM modules #1529
Comments
Fantastic minimal reproduction! Thank you @pi0 |
Ideally we need a reproduction that only uses workerd, then I can transfer this over to https://github.com/cloudflare/workerd |
I just tried deploying the worker and it actually seems to be working fine in workerd 😕 : https://wasm-bug-worker.dario-piotrowicz.workers.dev/ Could this be related to how Miniflare imports such modules rather than there being something wrong in workerd itself? |
I managed to reproduce this just with workerd: https://github.com/petebacondarwin/toplevel-async-wasm-workerd-repro So I propose we transfer this issue there... Interestingly @pi0 - the issue can be avoided if you do not use the async |
We've experienced the same |
Which Cloudflare product(s) does this pertain to?
Miniflare
What version(s) of the tool(s) are you using?
3.20231218.0
What version of Node are you using?
v20.10.0
What operating system are you using?
Mac
Describe the Bug
When using dynamic imports to load two wasm modules in parallel using top-level await, any second
await
attempt failed with an uncaught error.Minimal Reproduction: https://github.com/pi0/miniflare-reproduction
mode-a.mjs
andmode-b.mjs
:worker.mjs
:Note: Importing alone works, but any attempt to access or call exports fails with error:
Stack trace: (attached)
(minfilare config uses
modules: true
+moduleRules
forCompiledWasm
)Context: Discovered in tests while working on unjs/unwasm#11 (unwasm will be used as the default WASM handler for Nuxt and Nitro projects and also for CF deployments 🔥 )
the
Please provide a link to a minimal reproduction
https://github.com/pi0/miniflare-reproduction
Please provide any relevant error logs
The text was updated successfully, but these errors were encountered: