ITADN

WASM builds fail with wasm-bindgen "failed to find N in function table" on rustc 1.94+

#4672Openksr-13 创建于 2026-04-01
K
ksr-13commented
## The Bug Leptos 0.8.x WASM builds fail when processed by wasm-bindgen CLI (0.2.115-0.2.117). The error occurs because wasm-bindgen can't find certain function table entries that the WASM file references. thread 'main' panicked at crates/cli-support/src/wit/outgoing.rs:257:61: called Result::unwrap() on an Err value: failed to find 33345 in function table ## Steps to Reproduce 1. Create a Leptos 0.8.x project with wasm-bindgen 2. Build with `cargo build --target wasm32-unknown-unknown --release` 3. Run `wasm-bindgen --target=web --out-dir=out app.wasm` ## Expected Behavior wasm-bindgen should successfully generate JS bindings. ## Actual Behavior Panics with "failed to find N in function table". ## Environment - **Leptos version**: 0.8.17 - **wasm-bindgen version**: 0.2.117 - **rustc version**: 1.94.1 (stable), nightly-2026-03-20 - **OS**: macOS aarch64 ## Additional Context - This appears to be a compatibility issue between rustc 1.94's wasm codegen and wasm-bindgen's function table lookup - A minimal wasm-bindgen project works fine - the issue is specific to Leptos's heavy use of closures/reactive signals - The WASM file is ~2.2MB - Also filed on wasm-bindgen: https://github.com/wasm-bindgen/wasm-bindgen/issues/5076
1 条评论