Currently, the Javascript generated by dart2Js converter is very unintuitive to debug and doesn't produce intelligible error messages.
Is there a specific way that people use to debug Javascript code generated by dart?
I would like to get to the Dart line that is responsible for the error.
Also it would be great to see core dump and stack frames in terms of Dart code.
At first ensure that you build with pub build --mode=debug
.
This prevents minification and tree shaking.
Ensure that source maps are activated in Chrome devtools.
(DevTools settings - General - Sources - Enable JavaScript source maps).
Launch the application and debug.
The Chrome debugger should now show Dart source code when stepping through.
There seems to be an issue that the script used by default doesn't reference source maps How make pub build to use source maps on dart polymer projects
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With