cloudflare / cloudflare/workers-rs
🐛 BUG:Can't call javascript from a WASM worker
- Dominant language
- Rust
- Stars
- 3.7k
- Forks
- 429
- Avg merge
- 20h 28m
- Merged PRs (30d)
- 7
Description
### What version of `Wrangler` are you using?
2.1.13
### What operating system are you using?
Linux
### Describe the Bug
I can't call a JS function from my WASM worker, no matter how I call it. Here's an example function:
```
#[wasm_bindgen(inline_js = "export function blah() { console.log('blah'); }")]
extern "C" {
fn blah();
}
```
The error I get is the following:
```
✘ [ERROR] A request to the Cloudflare API (/accounts/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/workers/scripts/pijul) failed.
Uncaught TypeError: WebAssembly.Instance(): Import cloudflare/wrangler2#10
module="./snippets/blah-xxxxxxxxxxxxxx/inline0.js" error: module is not an object or function
at shim.js:13:9
[code: 10021]
```
Contributor guide
Assessment
This issue has not been assessed yet.