Skip to content

js-sys should not be used when targeting wasm32-wasi #441

Closed
@tqwewe

Description

@tqwewe

Describe the bug

js-sys brings in wasm-bindgen when targeting wasm32 architechture.
However, wasm32-wasi targets should not use js-sys not wasm-bindgen.

The cargo toml should be updated to be something like [target.'cfg(target_arch = "wasm32", target_os = "unknown")'.dependencies] for js-sys.

This causes issues when compiling to wasm components, as when trying to convert a crate which uses wasm-bindgen to a wasm component results in the following error:

error: failed to encode a component from module

Caused by:
    0: module requires an import interface named `__wbindgen_placeholder__`

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions