Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error: 'dart:ffi' can't be imported when compiling to Wasm #1796

Open
1 of 5 tasks
abrarmalekji345 opened this issue Dec 18, 2024 · 6 comments
Open
1 of 5 tasks

Error: 'dart:ffi' can't be imported when compiling to Wasm #1796

abrarmalekji345 opened this issue Dec 18, 2024 · 6 comments
Labels
bug Something isn't working needs triage

Comments

@abrarmalekji345
Copy link

abrarmalekji345 commented Dec 18, 2024

Describe the bug
Can't run Flutter web WASM app after updating Flutter version to 3.27.1

Expected behavior
Should run Flutter web app compiled with Web Assembly

Screenshots
Screenshot 2024-12-18 at 3 55 49 PM

Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.1, on macOS 14.5 23F79 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] Network resources

• No issues found!

Desktop (please complete the following information):

  • iOS
  • Android
  • Browser
  • Windows
  • Linux
@abrarmalekji345 abrarmalekji345 added bug Something isn't working needs triage labels Dec 18, 2024
@navarrete0
Copy link

Hello, what do we need to continue with this? thank you.

@abrarmalekji345
Copy link
Author

@navarrete0 For now I had to comment printing package on pubspec.yaml to run on web-assembly.

@vladimir-boyko
Copy link

The issue still persists and is a blocker for using wasm in flutter web app

@mikeesouth
Copy link

Yeah, same here - this is one of three blockers for us when moving to wasm. Commenting it for web assembly isn't really a fix for us as the pdf package is an important part of our offering.

@DavBfr do you have any plans on supporting dart:ffi ? I haven't investigated how this package uses ffi but maybe https://pub.dev/packages/universal_ffi could be a simple solution?

@vladimir-boyko
Copy link

Yeah, same here - this is one of three blockers for us when moving to wasm. Commenting it for web assembly isn't really a fix for us as the pdf package is an important part of our offering.

@DavBfr do you have any plans on supporting dart:ffi ? I haven't investigated how this package uses ffi but maybe https://pub.dev/packages/universal_ffi could be a simple solution?

Creating fork and replacing ffi with universal_ffi did help to compile library for wasm

@vladimir-boyko
Copy link

Opened a pr to resolve issue: #1812

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

4 participants