flutter_rust_bridge
flutter_rust_bridge copied to clipboard
Out of the box web support
Currently building a newly created flutter:
flutter create new_app
then add flutter_rust_bridge support:
flutter_rust_bridge_codegen integrate
then build for web:
flutter run -d web --wasm
produces all sort of issues.
Hi! Thanks for opening your first issue here! :smile:
Maybe check https://cjycode.com/flutter_rust_bridge/quickstart, e.g. to run it need
@fzyzcjy thank you for the reply, but still fore newly created app with newly integration added using:
flutter create new_app_with_rust_support
cd new_app_with_rust_support
flutter_rust_bridge_codegen integrate
flutter_rust_bridge_codegen build-web
flutter run --web-header=Cross-Origin-Opener-Policy=same-origin --web-header=Cross-Origin-Embedder-Policy=require-corp
it produces one of the issues when I tried before which is:
Starting application from main method in: org-dartlang-app:/web_entrypoint.dart.
TypeError: WebAssembly.instantiate(): Argument 0 must be a buffer source
pkg/rust_lib_new_app_with_rust_support.js 519:44 __wbg_load
pkg/rust_lib_new_app_with_rust_support.js 868:40 __wbg_init
I am using
- flutter_rust_bridge: 2.10.0
- flutter: 3.32.4 • channel stable
For that one, maybe try https://github.com/fzyzcjy/flutter_rust_bridge/issues?q=sort%3Aupdated-desc%20is%3Aissue%20Argument%200%20must%20be%20a%20buffer%20source
@fzyzcjy I did understand what do you mean, is there a workaround, or it there is an upcoming fix for this issue ! I am building a high investment app and need access to native (c, c++) in my codebase. flutter_rust_bridge should give me a unified way (which I am very grateful for it, thnx). So I am in the decision making process. If there is an upcoming fix, or there is a work around please note it for me here.
@AlaaAlHallaq my suggestion above is to upgrade the wasm-related packages on your computer: https://github.com/fzyzcjy/flutter_rust_bridge/issues/2757#issuecomment-2953578173, and two users (#2757 and #2769) reports that this fixes the error.
Close since there seems to be solutions. But if there are any questions, feel free to reopen or ask!
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.