Skip to content

"No frames available" error when debugger is paused inside async javascript code. #5287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
annagrin opened this issue Feb 21, 2023 · 4 comments
Labels
screen: debugger Issues with the Debugger screen

Comments

@annagrin
Copy link
Contributor

annagrin commented Feb 21, 2023

Repro steps:

Flutter's example/hello_world directory:

  • run flutter run -d chrome
  • open the Dart DevTools uri
  • hit pause and run until you DevTools does not show where it stopped (takes about 5-6 attempts for me)
  • evaluate "true" in the evaluation box
  • observe "No frames available" error

image

Chrome does show a list of frames available, but all of them async and pretty sure they are all from js code:

image

Some background

In this example I paused the app, and hit javascript code with no frames on the stack related to dart.

@elliette looks like the error comes from DevTools, and it happens before the call to chromeProxyService.evaluateInFrame.

Potential solutions:

  • Make dwds continue executing until dart code is hit. Not sure what happens if it never does - in that case the pause will appear not working, so maybe we need a timeout with a warning? This change, if we prefer it, would be most easily done in dwds: Pause in dart code instead of JS when user hits pause? dart-lang/webdev#1999

  • Or simply assume we only have javascript frames in that case and report an error from DevTools describing that evaluating inside javascript code is not currently supported.

@elliette
Copy link
Member

elliette commented Mar 15, 2023

I investigated this first solution:

Make dwds continue executing until dart code is hit. Not sure what happens if it never does - in that case the pause will appear not working, so maybe we need a timeout with a warning? This change, if we prefer it, would be most easily done in dwds: dart-lang/webdev#1999

It's a pretty simple change to make that happen (simply set _isStepping to true here) , however if we never hit a dart location (and keep stepping further into JS code), it's an awful experience (see gif below, basically Chrome is stuck in an infinite stepping loop). I'm not sure a timeout could alleviate that.
Mar-15-2023 15-13-00

I think the solution I like a bit better is when we go to calculate the stack frames when an app is paused, we include JS frames if there are no dart frames available. I will open up a PR for that.

@annagrin
Copy link
Contributor Author

I don't think we should show JS frames - they are numerous and not useful. Let's brainstorm on this.

@elliette
Copy link
Member

Adding some notes from discussion:

  • Currently, if we pause in the injected client, we don't hit Dart SDK code by continuing to stepping (tried by pausing in Chrome DevTools and manually stepped >100 times. If we try to keep stepping we will end up in the situation above.
  • One option is to include source maps for the injected client, so if we pause there at least we will show the Dart stack trace and variables.
  • Another option is to use the new skipList option to exclude the injected client. I'm curious if this would also preventing us from pausing in the injected client in the first place.

Related: dart-lang/webdev#2034

@elliette
Copy link
Member

This has been fixed, we are now showing "No Dart frames, likely paused in JS" ( see #5427)

Opened DWDS bug to track what is left for DWDS: dart-lang/webdev#2467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
screen: debugger Issues with the Debugger screen
Projects
None yet
Development

No branches or pull requests

3 participants