Breakpoints in Dartium not working
Asked Answered
P

3

3

So if I add break points in .dart files that are located in /web directory of my project, it works fine. For example I'm using AngularDart and the main.dart file works. However when I try to put a breakpoint in anything in the /lib directory, Dartium doesn't stop on them.

How can I get the breakpoints in Dartium to work with the /lib directory?

Note that I've tried putting breakpoints with Dart Editor, IntelliJ with Dart Plugin and also directly in Dartium and nothing works. Is this intended?

Pullet answered 8/11, 2014 at 22:39 Comment(1)
It is absolutely not intended. We can set break point even dart:io library as well.Hypnos
J
6

To set breakpoints in dependencies search the source inside the (no domain) node and set the breakpoint there. Breakpoints don't hit when set somewhere in the packages node.

enter image description here

You can also use the breakpoint statement for the debugger top pop up. See Does Dart have a 'breakpoint' statement? for more details.

Junket answered 8/11, 2014 at 22:43 Comment(2)
Yes you're right. In Dartium you can see this when you go in the source tab: i.imgur.com/ZSWmyDe.png so the files can be found under packages and under (no domain) for me at least. If I put a break point in a file opened from (no domain) it works. Thanks Günter you're the man!Pullet
Thanks for confirming, I couldn't remember these details.Preferable
S
2

I will combine the accepted answer + comment to that answer. Breakpoints 100% works only when you set them for files inside (no domain) category on Sources tab.

As I understand, in category with your domain name they are working only for files that was included with <script> tag. They won't work for imported files.

I have created an issue: Dartium ignores breakpoints set not in (no domain) category.

Swope answered 13/11, 2014 at 21:6 Comment(2)
Did you try putting your .dart files directly in the /web directory? Seems to make it work for me (not in the (no domain) category)Pullet
@Pullet I won't break my app's structure for debugging purposes. And what if you need to debug packages? This solution won't help.Swope
H
0

If you set break pointors from Dart Editor, then you should run your application from Dart Editor.

If you're using Dartium only, then you should set break pointors from Chrome Developer Tool. (Accepted answer)

Hypnos answered 13/11, 2014 at 21:14 Comment(1)
Yeah that's what I did though. I tried putting the breakpoints from the IDE AND launching dartium from there, but also launching pub serve manually AND adding breakpoints directly in dartium.Pullet

© 2022 - 2024 — McMap. All rights reserved.