You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The raw_module extern blocks in quarto-system-runtime/src/wasm.rs import
absolute paths (/src/wasm-js-bridge/*.js) that hub-client serves through
Vite at runtime. wasm-bindgen generates unconditional require() calls
for these paths in the shim it produces, so any wasm32 binary that links
quarto-system-runtime — including the pampa wasm_lua tests — fails to
load under Node.js with MODULE_NOT_FOUND before any test body runs.
Add a js-bridge Cargo feature, default off. Gate the extern blocks
behind it, and provide stubs that return Err("js-bridge feature not
enabled") / false when off so the SystemRuntime impl still compiles.
wasm-quarto-hub-client opts in via features = ["js-bridge"]; pampa's
wasm test build does not, so the require()s disappear from the shim.
Native builds are unaffected (wasm.rs is #![cfg(target_arch = "wasm32")]).
That exposed a downstream panic-strategy problem: rust_lua_throw panics
propagated as wasm RuntimeError instead of being caught by
rust_lua_protected_call. Fix by mirroring wasm-quarto-hub-client's
rustflags (-C panic=unwind, +bulk-memory,+exception-handling,
-Zwasm-c-abi=spec) in the workspace-root .cargo/config.toml for wasm32
builds, and moving the LuaThrow marker type into wasm-c-shim so the
production build and the tests share it. Update design/plan docs and
dev-docs/wasm.md accordingly.
0 commit comments