You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add debugging capabilities to the dart tooling so we can easily debug wasm code, from within our IDEs.
There doesn't seem to be a good way to debug dart code that has been complied to wasm. I can set break points in the complied wasm code, but because there are no source maps this is quite useless, so i am back to debugging with strings.
For fast turnaround during development of apps in Dart for web we recommend to use DDC. Dart2wasm is (similar to dart2js) for deploying apps.
That being said if one has to debug issues that only happen with dart2wasm compiled apps, I can recommend using the -O0 flag (flutter build web --wasm -O0 / dart compile wasm -O0 ) which will turn off optimizations and keeps static symbol names, does not minify runtime type names, etc.
Additionally we do plan on offering source maps support (@osa1 is working on it atm)
@uldall Right now dart:ffi is not really supported in dart2wasm. It was somewhat available but not entirely functional. After cl/368343 lands we'll report an error when user code imports dart:ffi. dart:ffi support for the web is tracked at #46690
Activity
mkustermann commentedon May 21, 2024
For fast turnaround during development of apps in Dart for web we recommend to use DDC. Dart2wasm is (similar to dart2js) for deploying apps.
That being said if one has to debug issues that only happen with dart2wasm compiled apps, I can recommend using the
-O0flag (flutter build web --wasm -O0/dart compile wasm -O0) which will turn off optimizations and keeps static symbol names, does not minify runtime type names, etc.Additionally we do plan on offering source maps support (@osa1 is working on it atm)
felix-ht commentedon May 21, 2024
That was exactly the issue, JS is running fine, but i got lots of issues after compling to wasm.
Thanks for the info on the flags!
mkustermann commentedon May 21, 2024
If you run into any issues in our compilers, libraries etc, please don't hesitate to reach out!
uldall commentedon May 24, 2024
I am trying to build our Flutter application with wasm support:
$ flutter build web --wasm -O0I am however getting this error:
Any ideas on how I can debug this?
mkustermann commentedon May 29, 2024
@uldall Right now
dart:ffiis not really supported in dart2wasm. It was somewhat available but not entirely functional. After cl/368343 lands we'll report an error when user code importsdart:ffi.dart:ffisupport for the web is tracked at #46690mkustermann commentedon May 29, 2024
I'm going to close this in favor of the older #55229.
[beta] [dart2wasm] Generate source maps