question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot set breakpoint for "Debug in Browser" test

See original GitHub issue

Files

I have this configuration in launch.json:

        {
            "name": "Debug in Browser",
            "request": "launch",
            "type": "dart",
            "template": "debug-test",
            "args": [
                "-p",
                "chrome"
            ]            
        }

and this test file:

import 'package:test/test.dart';
void main() {
    test('read write', () async {
      expect(1, 1);
    });
}

Actions

  • I can see Debug in browser command in my test file as expected.
  • I set a breakpoint at expect(1, 1) line.
  • When I click on the Debug in browser command I can see following compilation message in command window but no breakpoint hits
Compiled 9,009,955 characters Dart to 1,035,479 characters JavaScript in 8.44 seconds
...
✓ read write
Exited

Doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, v1.13.6-pre.44, on Microsoft Windows [Version 10.0.18362.535], locale cs-CZ)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    X No Java Development Kit (JDK) found; You must have the environment variable JAVA_HOME set and the java binary      in your PATH. You can download the JDK from https://www.oracle.com/technetwork/java/javase/downloads/.       
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.4.0)
[!] Android Studio (version 3.5)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    X Unable to determine bundled Java version.
[√] VS Code (version 1.41.1)
[√] Connected device (3 available)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
PavelPZcommented, Jan 13, 2020

@DanTup, thanks a lot. I missed this vs code feature, everything is now easier.

0reactions
DanTupcommented, Jan 13, 2020

Sorry for the delay in responding! The launch.json you posted is good, though you don’t really need it - if you delete the launch.json, when you press F5 it will launch on whichever device is selected in the status bar:

Screenshot 2020-01-13 at 16 53 06

Clicking the device name there allows you to switch between devices (whereas the launch.json you showed will always run on Chrome, regardless of what’s selected here).

If you have any issues with this (or questions), do shout!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chrome DevTools won't let me set breakpoints on certain lines
We made our changes and then hit Ctrl + S (or Cmd + S) to save the changes in the debugger and then...
Read more >
Troubleshoot Breakpoints in the Visual Studio Debugger
Go to the Modules window (Debug > Windows > Modules) and check whether your module is loaded. If your module is loaded, check...
Read more >
Can't set Debugger breakpoints - Mozilla Discourse
I can no longer set breakpoints in the Debugger. It have tried 3 different ways and nothing works. I click on the line...
Read more >
Pause your code with breakpoints - Chrome Developers
Use breakpoints to pause your JavaScript code. This guide explains each type of breakpoint that's available in DevTools, as well as when to ......
Read more >
DevTools: Can't set breakpoints on inline Javascript - Monorail
URLs (if applicable) : Other browsers tested: Add OK or FAIL after other browsers where you have tested this issue: Safari 5: Firefox...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found