flutter_rust_bridge icon indicating copy to clipboard operation
flutter_rust_bridge copied to clipboard

Out of the box web support

Open AlaaAlHallaq opened this issue 5 months ago • 1 comments

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.

AlaaAlHallaq avatar Jun 16 '25 11:06 AlaaAlHallaq

Hi! Thanks for opening your first issue here! :smile:

welcome[bot] avatar Jun 16 '25 11:06 welcome[bot]

Maybe check https://cjycode.com/flutter_rust_bridge/quickstart, e.g. to run it need

Image

fzyzcjy avatar Jun 17 '25 00:06 fzyzcjy

@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

AlaaAlHallaq avatar Jun 24 '25 00:06 AlaaAlHallaq

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 avatar Jun 24 '25 14:06 fzyzcjy

@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 avatar Jun 25 '25 04:06 AlaaAlHallaq

@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.

fzyzcjy avatar Jun 25 '25 14:06 fzyzcjy

Close since there seems to be solutions. But if there are any questions, feel free to reopen or ask!

fzyzcjy avatar Jul 01 '25 14:07 fzyzcjy

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.

github-actions[bot] avatar Jul 15 '25 15:07 github-actions[bot]