You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stack traces in the debug console do not show links for "_patch" files #4727
For this stacktrace, the filename and line numbers are not identified and linked in the debug console by VS Code. They are treated simply as text.
In this stacktrace, also from the debug console, some of the lines are correctly linked back to source (shown indented on a new line here, but shown as right-justified links in the debug console window in VS Code), and some are not:
@lukehutch can you easily include a screenshot of what you're seeing here? Are the lines that aren't linked correctly the ones that wrap and/or don't have full dart: or package: URIs?
This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.
@lukehutch was this exception something you caught and then printed, or was it unhandled/caught only by Flutter? Is it the entire call stack that's not linked, or only some lines?
This was an uncaught exception. In this case, it was the entire stack trace that was unlinked. In other cases, it's just a few stack frames that are unlinked, sometimes in the middle of the stack trace.
Are you able to reproduce this in a small project you can share? There are some issues I know about in this area - one of them is fixed for the next SDKs but was Flutter-specific (#4571) and it's not clear if you hit this in Flutter, and the other only occurs when stack traces are printed (and not unhandled).
If you can share a repo, I can check whether there's another issue or this is one of those (and whether it's fixed or not for next release).
It doesn't seem to happen with any rhyme or reason, so I don't know that I can even produce a reproducer testcase for it. But I think there is something to be learned from the second stacktrace I gave in the original bug report: frames numbered 0 and 4-8 were not linked, but frames numbered 1-3 were linked. So it can even be some frames but not others in a single stacktrace that don't get linked. Therefore, it's not being caused by something like printing a stacktrace manually.
I got a video of this, although I don't know how to minimally reproduce this...
The whole stacktrace appears as a single entry in the console (the whole thing highlights on mouse-over). The individual source files are not clickable.
@lukehutch are you certain this is an unhandled exception printed to stderr and not an exception that was caught and print()ed? I would expect it to be red if it was stderr. If it's coming via stdout when I think this is probably a dupe of #4711?
I tracked down the cause of one case where stacktraces are not auto-linked: this happens when the user calls stdout.writeln('$stackTrace'), which I think is the bug you linked previously.
This doesn't account for some of the cases though where some frames are linked and some are not, within a single stacktrace, even though all code is in the same project.
@lukehutch are you testing with Flutter master? Do you have an example of unlinked frames that aren't a) printed via stdout and b) a _patch file? (those are both known issues.. the former needs to be fixed, the latter is not currently fixable).
@DanTup I'm on Flutter stable or beta (I switch back and forth). Master has had issues for my app.
I don't have examples of frames that don't fit those two categories -- my previous comment was confirming that in some of the cases I have observed, the frames were printed to stdout (I finally caught all exceptions and drilled down to where the stacktrace was being sent to the console).
The other examples I cited, where some stack frames were linked and others weren't, is probably from a patch file. Although I would like to see those frames labeled as such, so that it's obvious as to why they can't be linked. (And actually, even in those cases, it would be nice if a best-effort could be made to locate the actual source, since it's often there in the pub cache...)
So you can go ahead and close this, if you think all the bases are covered.
I think the only issue not solved here is the patch files. I don't know if we can handle this (because I don't know if we can compute paths, and there may be multiple patch files for different platforms).
But I'll keep this open to look at and at least figure out exactly what those issues are.
changed the title [-]Dart-Code is not always able to parse stacktraces[/-][+]Stack traces in the debug console do not show links for "_patch" files [/+]on Nov 15, 2023
I found one more area where code is not linked as it could/should be. This time, this is for output sent to stdout, and it's not stacktraces, it's the list of compilation errors that are given when you try to run code that has errors in it. The error lines are not linked:
It would be really helpful to have these lines linked.
@lukehutch thanks! Could you file a new issue for that one? I'm not sure how easily we can handle these ones, but it'll be a very different fix to the patch files. Thanks!
Activity
DanTup commentedon Sep 6, 2023
@lukehutch can you easily include a screenshot of what you're seeing here? Are the lines that aren't linked correctly the ones that wrap and/or don't have full
dart:orpackage:URIs?github-actions commentedon Sep 27, 2023
This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.
lukehutch commentedon Sep 27, 2023
I'll try to add a screenshot next time this happens.
lukehutch commentedon Oct 2, 2023
OK, here is an example screenshot, where the filenames and line numbers are not parsed out and made linkable. They appear in the console as plaintext:
DanTup commentedon Oct 2, 2023
@lukehutch was this exception something you caught and then
printed, or was it unhandled/caught only by Flutter? Is it the entire call stack that's not linked, or only some lines?Thanks!
lukehutch commentedon Oct 2, 2023
This was an uncaught exception. In this case, it was the entire stack trace that was unlinked. In other cases, it's just a few stack frames that are unlinked, sometimes in the middle of the stack trace.
DanTup commentedon Oct 2, 2023
Are you able to reproduce this in a small project you can share? There are some issues I know about in this area - one of them is fixed for the next SDKs but was Flutter-specific (#4571) and it's not clear if you hit this in Flutter, and the other only occurs when stack traces are printed (and not unhandled).
If you can share a repo, I can check whether there's another issue or this is one of those (and whether it's fixed or not for next release).
Thanks!
lukehutch commentedon Oct 2, 2023
It doesn't seem to happen with any rhyme or reason, so I don't know that I can even produce a reproducer testcase for it. But I think there is something to be learned from the second stacktrace I gave in the original bug report: frames numbered 0 and 4-8 were not linked, but frames numbered 1-3 were linked. So it can even be some frames but not others in a single stacktrace that don't get linked. Therefore, it's not being caused by something like printing a stacktrace manually.
lukehutch commentedon Oct 15, 2023
I got a video of this, although I don't know how to minimally reproduce this...
The whole stacktrace appears as a single entry in the console (the whole thing highlights on mouse-over). The individual source files are not clickable.
screen-recording-.2.mp4
DanTup commentedon Oct 16, 2023
@lukehutch are you certain this is an unhandled exception printed to
stderrand not an exception that was caught andprint()ed? I would expect it to be red if it was stderr. If it's coming via stdout when I think this is probably a dupe of #4711?lukehutch commentedon Oct 16, 2023
If somebody printed this, it wasn't me :-D Honestly I have no idea which IO channel this was printed to.
I think this is in fact a dup of #4711, so I'll close in favor of that issue. Thanks!
16 remaining items
lukehutch commentedon Nov 2, 2023
Ah, I was on the Flutter master channel a few times lately, but there was some breakage (I don't remember what), so I backed off, and I'm on beta now.
lukehutch commentedon Nov 14, 2023
I tracked down the cause of one case where stacktraces are not auto-linked: this happens when the user calls
stdout.writeln('$stackTrace'), which I think is the bug you linked previously.This doesn't account for some of the cases though where some frames are linked and some are not, within a single stacktrace, even though all code is in the same project.
DanTup commentedon Nov 14, 2023
@lukehutch are you testing with Flutter
master? Do you have an example of unlinked frames that aren't a) printed via stdout and b) a_patchfile? (those are both known issues.. the former needs to be fixed, the latter is not currently fixable).lukehutch commentedon Nov 14, 2023
@DanTup I'm on Flutter stable or beta (I switch back and forth). Master has had issues for my app.
I don't have examples of frames that don't fit those two categories -- my previous comment was confirming that in some of the cases I have observed, the frames were printed to stdout (I finally caught all exceptions and drilled down to where the stacktrace was being sent to the console).
The other examples I cited, where some stack frames were linked and others weren't, is probably from a patch file. Although I would like to see those frames labeled as such, so that it's obvious as to why they can't be linked. (And actually, even in those cases, it would be nice if a best-effort could be made to locate the actual source, since it's often there in the pub cache...)
So you can go ahead and close this, if you think all the bases are covered.
DanTup commentedon Nov 15, 2023
I think the only issue not solved here is the patch files. I don't know if we can handle this (because I don't know if we can compute paths, and there may be multiple patch files for different platforms).
But I'll keep this open to look at and at least figure out exactly what those issues are.
[-]Dart-Code is not always able to parse stacktraces[/-][+]Stack traces in the debug console do not show links for "_patch" files [/+]lukehutch commentedon Nov 22, 2023
I found one more area where code is not linked as it could/should be. This time, this is for output sent to stdout, and it's not stacktraces, it's the list of compilation errors that are given when you try to run code that has errors in it. The error lines are not linked:
It would be really helpful to have these lines linked.
DanTup commentedon Nov 22, 2023
@lukehutch thanks! Could you file a new issue for that one? I'm not sure how easily we can handle these ones, but it'll be a very different fix to the patch files. Thanks!
lukehutch commentedon Nov 23, 2023
@DanTup I created #4853 for this. Thanks!
DanTup commentedon Feb 10, 2025
This was fixed recently, the frames are clickable - including
_patchfiles: