-
Notifications
You must be signed in to change notification settings - Fork 324
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
Build for Web fails: error: cannot import from modules (env
) with --no-modules
#1915
Comments
Hi! Thanks for opening your first issue here! 😄 |
Hmm, looks like currently frb needs In addition, it may also be some bug in wasm compile: rust-lang/rust#93557 - could you please try that and see whether it solves the problem? |
Thank you for the quick reply and telling about the limitation of no-modules. I will create in issue in the zstd-rs library for using the library with no-modules, as no trick with wasm-pack helped me actually compiling it. It's fun to integrate rust code into my app, thank you for your work! |
You are welcome and happy to see it works! |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue. |
Describe the bug
I try to integrate the zstd library into the rust code. When doing this, I get this to compile for all targets except for wasm/web.
This is the error message I received:
My cargo.toml includes these two dependencies:
I got zstd to compile to the wasm32-unknown-unknown target, but I didn't got this to work with the no-modules restriction, do you have any solution for this? As there is no support for zstd in dart, I thought that this would be useful to use the rust_bridge for, and on other targets this worked perfectly.
Best regards.
Steps to reproduce
Add these dependencies:
[dependencies]
flutter_rust_bridge = "=2.0.0-dev.32"
zstd = { git = "https://github.com/jbms/zstd-rs.git", branch = "fix-wasm32-unknown-unknown" }
utils.rs (+ adding this in mod.rs):
Running flutter_rust_bridge_codegen build-web
Logs
Expected behavior
No response
Generated binding code
No response
OS
MacOS
Version of
flutter_rust_bridge_codegen
2.0.0-dev.32
Flutter info
No response
Version of
clang++
Homebrew clang version 18.1.4
Additional context
No response
The text was updated successfully, but these errors were encountered: