McDuck
McDuck

Reputation: 760

dart angular vs debugging

I just got started with dart and I have managed to configure correctly dart command line projects and a flutter app within vs code, and debugging works as expected, to attempt a cross platform project However with dart angular, i cant get breakpoints to work, the docs in the dart seem to focus mostly in flutter however i cant breakpoint within just this specific type of dart project. This is my current dart launch.json.

{ 
"version": "0.2.0",
  "configurations": [
    {
      "name": "Dart",
      "program": "web/main.dart",
      "request": "launch",
      "type": "dart"
    }
  ]
}

I am using dart version 2.9.1.

Upvotes: 1

Views: 101

Answers (1)

Danny Tuppeny
Danny Tuppeny

Reputation: 42383

however i cant breakpoint within just this specific type of dart project

Right now there is a race condition in non-Flutter web debugging, where the breakpoints are not set up before the app starts, so any breakpoints in startup code are missed.

There's an open issue at https://github.com/dart-lang/webdev/issues/830 but as a workaround you could try inserting a delay (eg. await Future.delayed(const Duration(seconds: 1)) or calling the debugger function at the top of your main function if you need to break in startup code).

Upvotes: 1

Related Questions