Skip to content
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: Running rust example generated via cargo generate cloudflare/workers-rs fails Uncaught LinkError: WebAssembly.Instance() #7208

Closed
pmalek opened this issue Nov 8, 2024 · 6 comments
Labels
bug Something that isn't working

Comments

@pmalek
Copy link

pmalek commented Nov 8, 2024

Which Cloudflare product(s) does this pertain to?

Other

What version(s) of the tool(s) are you using?

3.86.0 [Wrangler]

What version of Node are you using?

23.1.0

What operating system and version are you using?

Mac Sequoia 15.0.1

Describe the Bug

Observed behavior

Running rust example generated with cargo generate cloudflare/workers-rs fails with the following error message:

[INFO]: ⬇️  Installing wasm-bindgen...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: ✨   Done in 0.26s
[INFO]: 📦   Your wasm pkg is ready to publish at /Users/USER/code_/own/cfworker1/asd/build.

The file src changed, restarting build...
Running custom build: cargo install -q worker-build && worker-build --release
[wrangler:inf] Ready on http://localhost:8787
╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│  [b] open a browser, [d] open devtools, [l] turn off local mode, [c] clear console, [x] to exit  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
    Finished `release` profile [optimized] target(s) in 0.04s
[INFO]: ⬇️  Installing wasm-bindgen...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: ✨   Done in 0.22s
[INFO]: 📦   Your wasm pkg is ready to publish at /Users/USER/code_/own/cfworker1/asd/build.

⎔ Starting local server...
✘ [ERROR] service core:user:asd: Uncaught LinkError: WebAssembly.Instance(): Import #9 "./index_bg.js" "__wbg_error_53abcd6a461f73d8": function import requires a callable

    at null.<anonymous> (shim.js:41:9)



✘ [ERROR] The Workers runtime failed to start. There is likely additional logging output above.

Expected behavior

Please describe.

Steps to reproduce

Please provide the following:

  • A minimal working subset of your worker code
  • A minimal working subset of your wrangler.toml
  • Commands used to start your local dev server, including custom env and cli args
  • Steps to be performed in the browser, curl commands, or a test we can run that reliably fails (at least a percent of the time)

A git repo we can clone and run a test suite on, or which has a README with step-by-step instructions, is even better. In this case, please use the field below to provide a link to the minimal repro.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@pmalek pmalek added the bug Something that isn't working label Nov 8, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Nov 8, 2024
@pmalek pmalek changed the title 🐛 BUG: 🐛 BUG: Running rust example generated via cargo generate cloudflare/workers-rs fails Uncaught LinkError: WebAssembly.Instance() Nov 8, 2024
@o-az
Copy link

o-az commented Nov 9, 2024

downgrade to rust 1.81.0 should fix it

@pmalek
Copy link
Author

pmalek commented Nov 9, 2024

I can confirm, downgrading to 1.81 works. Any particular reason this doesn't work with 1.82? Can't this be enforced somehow through dependency requirements?

@o-az
Copy link

o-az commented Nov 9, 2024

I have no idea and I found out by luck 😁

@brentschroeter
Copy link

Having the same issue, also fixed by downgrading to 1.81. Searching through GitHub issues for other projects, seems to be that Rust 1.82 enables new LLVM features by default, including WASM reference type transformations which are not yet supported by all JS tooling (for example rustwasm/wasm-bindgen#4211).

@fornwall
Copy link

Issue in workers-rs: cloudflare/workers-rs#668

@penalosa
Copy link
Contributor

Closing in favour of cloudflare/workers-rs#668

@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Done
Development

No branches or pull requests

5 participants