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

rust nightly errors with doesn't have an adapter listed #1929

Closed
ctaggart opened this issue Dec 23, 2019 · 4 comments · Fixed by #1942
Closed

rust nightly errors with doesn't have an adapter listed #1929

ctaggart opened this issue Dec 23, 2019 · 4 comments · Fixed by #1942
Labels

Comments

@ctaggart
Copy link
Contributor

With rust nightly, I'm getting one of these two errors:

error: import of `__wbg_cargowebsnippetc26ddf75f581148e029dfcd95c037bb50d502e43_f494f4a63cf92998` doesn't have an adapter listed
Error: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit code: 1

error: import of `__wbg_cargowebsnippetc26ddf75f581148e029dfcd95c037bb50d502e43_f494f4a63cf92998` doesn't have an import map item listed
Error: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit code: 1

I'm building with wasm-pack build --target web.

$ cargo install-update --list
Package           Installed  Latest    Needs update
wasm-bindgen-cli  v0.2.56    v0.2.56   No
wasm-pack         v0.8.1     v0.8.1    No

rustup default nightly
nightly-x86_64-apple-darwin unchanged - rustc 1.42.0-nightly (9b98af84c 2019-12-22)

It is working fine on rust stable.

@ctaggart ctaggart added the bug label Dec 23, 2019
@trivigy
Copy link

trivigy commented Jan 4, 2020

Same exact error here. Seems that even the hashes match up. Would greatly appreciate some recommendation on how to debug this. I am on a slightly newer nightly version. rustc 1.42.0-nightly (3a3f4a7cb 2019-12-28)

EDIT: One other thing that I tested is that this issue doesn't seem to exist in nightly-2019-12-20 but does happen beginning with nightly-2019-12-30.

error: import of `__wbg_cargowebsnippetc26ddf75f581148e029dfcd95c037bb50d502e43_f494f4a63cf92998` doesn't have an adapter listed
Error: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit code: 1

alexcrichton added a commit to alexcrichton/wasm-bindgen that referenced this issue Jan 6, 2020
The wasm-bindgen nightly test suite started failing recently and a
bisection shows that rust-lang/rust#67363 is the cause of this issue.
The problem happening here is that after that Rust PR duplicate imports
from the same name/module in different parts of a Rust program may now
show up as duplicate imports rather than being coalesced into one
import. This was tripping up `wasm-bindgen` which, when translating from
the wasm module to wasm-bindgen's IR, is unfortunately very
string-based.

The fix here was to detect these duplicate imports and map them all to
the same item, removing the duplicate imports.

Closes rustwasm#1929
@alexcrichton
Copy link
Contributor

Thanks for the report! The bad news is that this was a breakage caused by a behavior change in upstream Rust, but the good news is that our internal test suite caught it and I just was on break and wasn't around to fix it! I've posted a fix for this at #1942

alexcrichton added a commit that referenced this issue Jan 6, 2020
The wasm-bindgen nightly test suite started failing recently and a
bisection shows that rust-lang/rust#67363 is the cause of this issue.
The problem happening here is that after that Rust PR duplicate imports
from the same name/module in different parts of a Rust program may now
show up as duplicate imports rather than being coalesced into one
import. This was tripping up `wasm-bindgen` which, when translating from
the wasm module to wasm-bindgen's IR, is unfortunately very
string-based.

The fix here was to detect these duplicate imports and map them all to
the same item, removing the duplicate imports.

Closes #1929
@ctaggart
Copy link
Contributor Author

ctaggart commented Jan 6, 2020

Hope you had a wonderful break! Thanks for the fix. I really like wasm-bindgen.

@t-moe
Copy link

t-moe commented Jun 25, 2024

Without having a full reproducer at hand, my colleague observed
error: import of __wbindgen_array_new doesn't have an adapter listed
today when running wasm-bindgen on his mac...

he was also using rust nightly and a command like wasm-pack build --target browser --mode normal --no-typescript

anybody else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants