How can I debug Dart Builders with breakpoints in WebStorm

Issue

Dart uses the build package to generate code. What if you want to debug your own Builder or an existing one?

Solution

Instead of calling pub run build_runner you can execute and debug the file build.dart which can be found here:

.dart_tool/build/entrypoint/

enter image description here

To enter your command like serve as in pub run build_runner serve you can edit your debug configurations:

enter image description here

Put the command inside the field Program arguments:

enter image description here

Click Apply and start debugging again. Webstorm will interrupt when a breakpoint is reached.

Answered By – HerrJohr

Answer Checked By – Mary Flores (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.