From 153505f6c7c9b3c604bf01685685f4870748e4bb Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Wed, 8 Aug 2018 20:28:49 +0200 Subject: [PATCH] Document workaround for avoiding duplicated symbols when using wasm-bindgen-test from git --- crates/test/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/test/README.md b/crates/test/README.md index 442e89c0..7ea4421a 100644 --- a/crates/test/README.md +++ b/crates/test/README.md @@ -33,6 +33,19 @@ ton of documentation just yet, but a taste of how it works is: # or [target.'cfg(target_arch = "wasm32")'.dev-dependencies] wasm-bindgen-test = { git = 'https://github.com/rustwasm/wasm-bindgen' } ``` + + **WARNING**: the `console_error_panic_hook` has a dependency on `wasm-bindgen` + from `crates.io` which conflicts with the one from git used by `wasm-bindgen-test`: + it produces linker errors due to duplicated symbols. + + Until `wasm-bindgen-test` is released on `crates.io`, the temporary workaround + is to patch the `crates.io`'s `wasm-bindgen` dependency to be the same that + `wasm-bindgen-test` uses by adding the following to your project's `Cargo.toml`: + + ```toml + [patch.crates-io] + wasm-bindgen = { git = 'https://github.com/rustwasm/wasm-bindgen' } + ``` * Next, write some tests!