English 中文(简体)
Us(gRPC)和Leptos(WASM)
原标题:Using Tonic (gRPC) & Leptos (WASM)

I am trying to use both Tonic (gRPC) & Leptos (WASM) together. I ve tried with other WASM frameworks (Yew & Dioxus) which works well, but Leptos returns the following 2000+ line long error.

...

"/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/librustc_std_workspace_alloc-c38a59bfc0e9dbea.rlib"
 "/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libminiz_oxide-64c97e1f297aaa2a.rlib" "/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libadler-41daeb18b4cf5212.rlib" 
"/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libunwind-2e14c4e869ef0095.rlib" "/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcfg_if-6ab2d55e0fc6736f.rlib" 
"/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/liblibc-b63bc9b0d1ee276a.rlib" "/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/liballoc-7a6735befdece646.rlib" 
"/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/librustc_std_workspace_core-907cd1f856ca6753.rlib" "/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcore-808c25238bc298db.rlib" 
"/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcompiler_builtins-6e2299aadeb4eab9.rlib" "-L" 
"/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib" "-L" "/Users/vb/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/self-contained" "-o" "/Users/vb/Documents/Github/tonic-web-leptos-minimal/client/target/wasm32-unknown-unknown/debug/deps/client-b6b34c1043101ef6.wasm" "--gc-sections" "-O0"

...

          rust-lld: error: duplicate symbol: intounderlyingsource_pull
          >>> defined in /Users/vb/Documents/Github/tonic-web-leptos-minimal/client/target/wasm32-unknown-unknown/debug/deps/libwasm_streams-c0e6bacf3ec8ab2b.rlib(wasm_streams-c0e6bacf3ec8ab2b.wasm_streams.e355e7508143bf01-cgu.7.rcgu.o)
          >>> defined in /Users/vb/Documents/Github/tonic-web-leptos-minimal/client/target/wasm32-unknown-unknown/debug/deps/libwasm_streams-21e4560d2007218a.rlib(wasm_streams-21e4560d2007218a.wasm_streams.fe87211425a80c26-cgu.8.rcgu.o)

          rust-lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)


warning: `client` (bin "client") generated 1 warning
error: could not compile `client` (bin "client") due to 1 previous error; 1 warning emitted
2024-02-06T22:49:26.254651Z ERROR ❌ error
error from build pipeline

Caused by:
    0: HTML build pipeline failed (1 errors), showing first
    1: error from asset pipeline
    2: error during cargo build execution
    3: cargo call to executable  cargo  with args:  ["build", "--target=wasm32-unknown-unknown", "--manifest-path", "/Users/vb/Documents/Github/tonic-web-leptos-minimal/client/Cargo.toml"]  returned a bad status: exit status: 101

是否有任何人在提出可能的解决办法之前遇到过这一错误?

我已经核对了<https://github.com/rust-lang/rust/issues/52909” rel=“nofollow noreferer”>,,treleases/prepf/rest. 这似乎是一个主要由鲁斯特人遇到的问题。

问题回答

I just came across this issue, it means you have two different versions of wasm-streams being required. Check your Cargo.toml for the conflicting versions and see if you can trace back to where the discrepancy is.

你们看到这样的东西。

“Vasm-streams vX.X.X”

其他

“Wasm-streams vY.Y.Y.”

它可以是一条轨道,但cargo树可有所帮助。





相关问题
Creating an alias for a variable

I have the following code in Rust (which will not compile but illustrates what I am after). For readability purposes, I would like to refer the same string with two different names so that the name of ...

Rust Visual Studio Code code completion not working

I m trying to learn Rust and installed the Rust extension for VSCode. But I m not seeing auto-completions for any syntax. I d like to call .trim() on String but I get no completion for it. I read that ...

热门标签