workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: wrangler dev wasm not working

Open kesavkolla opened this issue 3 years ago • 2 comments

What version of Wrangler are you using?

2.0.25

What operating system are you using?

Linux

Describe the Bug

I have installed the wrangler2 using the following command:

npm --location=global i wrangler@latest

I got the latest version of wrangler

wrangler -v

⛅️ wrangler 2.0.25

When I try to run my wasm module using wrangler dev I get the following error:

✘ [ERROR] No loader is configured for ".wasm" files: target/wasm32-wasi/release/hello-world.wasm

kesavkolla avatar Aug 13 '22 19:08 kesavkolla

Yeah, it's broken. Same thing on Windows, and when trying to publish @threepointone Did you get it working on your end, with your recent fixes?

kpietraszko avatar Aug 30 '22 19:08 kpietraszko

To help us diagnose this further, would you be able to provide some more information about your environment? Specifically, the contents of your wrangler.toml would be really useful—thanks!

penalosa avatar Sep 20 '22 16:09 penalosa

Hey 👋 ! We haven't heard from you about this so we are going to close this. If you have further clarification on this please feel free to reopen this, or open another issue with some more details

cameron-robey avatar Sep 26 '22 15:09 cameron-robey

I hit the exact same issue when following the steps in this blog post

Seems like everything in that blog post just doesn't work:tm:

For instance also: https://hexly.examples.workers.dev/ 404's

fwiw here's my wrangler.toml

name = "cf-workers-test"
compatibility_date = "2022-09-30"

And how I got there:

> wrangler2 dev target/wasm32-wasi/release/hello_world.wasm

But also, did this ever work? https://github.com/cloudflare/wrangler2/blob/main/packages/wrangler/src/entry.ts#L156

estk avatar Sep 30 '22 04:09 estk

@cameron-robey @penalosa

estk avatar Sep 30 '22 15:09 estk

It looks like one way to work around the problem is to set up a rollup build and treat the wasm bundle as an external. I found an example of that here: https://github.com/ssssota/svg2png-worker .

That said, it would be great if wasm worked out of the box.

bebraw avatar Jan 01 '23 11:01 bebraw