dart-lang / dart-lang/webdev

Breakpoints set in a Dart web app with vscode are not being before the app runs

Open
#2,808 7 comments 0 reactions 0 assignees View on GitHub
P2 package:dwds triaged type-bug
Dominant language
Dart
Stars
224
Forks
94
Avg merge
4d 3h
Merged PRs (30d)
2

Description

Repro:
1. Open the example directory (https://github.com/dart-lang/webdev/tree/main/example) in vscode.
2. Set a breakpoint in main.dart on line 13. https://github.com/dart-lang/webdev/blob/5b7299f5b85706536aeac1c9f470b869ddb39fef/example/web/main.dart#L13
3. Click the debug link vscode inserts above the main method.

You should see the app build and start running, chrome pops up and there will be prints appearing in the vscode debug console.

```
Initial Print :)
Counter is now: 1
Counter is now: 2
Counter is now: 3
Counter is now: 4
...
```

4. Now add a breakpoint on line 23. https://github.com/dart-lang/webdev/blob/5b7299f5b85706536aeac1c9f470b869ddb39fef/example/web/main.dart#L23

You should see execution will pause.

5. Click the "Restart" button in the vscode debugging UI to hot restart the app.

You should see that the breakpoint on line 13 is skipped again but the breakpoint on line 23 still works.

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior from the example directory using example/web/main.dart, setting breakpoints on lines 13 and 23 and restarting through the VS Code debugging UI. Start by tracing how the Dart web debug session handles breakpoints across hot restart. Done means the breakpoint on line 13 is hit after restart while the breakpoint on line 23 continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, vscode
Domain
devtools, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.