-
Notifications
You must be signed in to change notification settings - Fork 307
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
flutter_rust_bridge_codegen build-web
fails due to no Flutter SDK
#2480
Comments
Hi! Thanks for opening your first issue here! 😄 |
Hmm that's weird. We have CI to ensure such commands does work... Could you please share your created project (i.e. the folder you create in "steps to reproduce"), e.g. as a temporary github repo. |
Sure, I've pushed it here |
Hmm try |
Yep, I ran this to create that repo flutter create frb_web_bug_demo
cd frb_web_bug_demo
flutter_rust_bridge_codegen integrate
flutter_rust_bridge_codegen build-web Here's the logs with
|
Hmm it does not mention the toolchain or command used (but yes judging from command it may wrongly use dart). Maybe add another
|
A simple hack to work around the issue (albeit using a deprecated method) is by running: flutter pub run flutter_rust_bridge build-web --dart-root <<flutter project dir>> <<flags for FRB (i.e. --verbose)>> I don't know what repercussions there are to using the dart package directly instead of going through the rust wrapper, but it seems to work fine for now. |
For the record, a similar issue occurs when running $ dart run flutter_rust_bridge:serve
Resolving dependencies in `/workspaces/flutter-proj`...
Because flutter-proj depends on integration_test from sdk which doesn't exist (the Flutter SDK is not available), version
solving failed.
Flutter users should use `flutter pub` instead of `dart pub`. The workaround does not work with this command, however. $ flutter pub run flutter_rust_bridge:serve
Deprecated. Use `dart run` instead.
Could not find bin/serve.dart in package flutter_rust_bridge. EDIT: has |
Describe the bug
I'm trying to add some Rust code to my Flutter Web application, and am unable to run the
build-web
command because of the error included below. I haven't modified the generated code at all, just trying tointegrate
then run.Having a look at the code for the CLI, it looks like it's trying to invoke
dart ...
rather thanflutter ...
, so it's not able to resolve theflutter
dependency from the SDK. This feels like a bug, but this is my first time using FRB, so I'm not sure if this user error on my part.Unfortunately, the project is closed-source, so I can't share it here, but I was able to reproduce the same behavior from a fresh flutter web app created with
flutter create foo
Steps to reproduce
flutter create foo
flutter_rust_bridge_codegen integrate
flutter_rust_bridge_codegen build-web
Logs
Expected behavior
It builds the web code
Generated binding code
No response
OS
Linux (NixOS)
Version of
flutter_rust_bridge_codegen
2.7.0
Flutter info
The text was updated successfully, but these errors were encountered: