Sdk: org-dartlang-debug:synthetic_debug_expression:1:1: Error

Created on 3 Mar 2019  路  23Comments  路  Source: dart-lang/sdk

I got an error on my mac, what i did is just hot reload project after coding a sub widget, i tried to find out what is wrong, just like run AS instead of vc code, clean cache, and restart mac...please get my some idea, thank you~

dart : 2.2.0
flutter: 1.2.1

here is the log:

Launching lib/main.dart on iPhone XR in debug mode...

Compiler message:
org-dartlang-debug:synthetic_debug_expression:1:1: Error: Getter not found: '_debugCanPerformMutations'.
_debugCanPerformMutations
^^^^^^^^^^^^^^^^^^^^^^^^^
org-dartlang-debug:synthetic_debug_expression:1:1: Error: The getter '_debugCanPerformMutations' isn't defined for the class 'RenderViewport'.
 - 'RenderViewport' is from 'package:flutter/src/rendering/viewport.dart' ('file:///Users/makw/flutter/packages/flutter/lib/src/rendering/viewport.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named '_debugCanPerformMutations'.
_debugCanPerformMutations
^^^^^^^^^^^^^^^^^^^^^^^^^
org-dartlang-debug:synthetic_debug_expression:1:1: Error: Getter not found: '_semanticsConfiguration'.
_semanticsConfiguration
^^^^^^^^^^^^^^^^^^^^^^^
org-dartlang-debug:synthetic_debug_expression:1:1: Error: The getter '_semanticsConfiguration' isn't defined for the class 'RenderViewport'.
 - 'RenderViewport' is from 'package:flutter/src/rendering/viewport.dart' ('file:///Users/makw/flutter/packages/flutter/lib/src/rendering/viewport.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named '_semanticsConfiguration'.
_semanticsConfiguration
^^^^^^^^^^^^^^^^^^^^^^^
area-vm

Most helpful comment

seems related to #35980

I fixed by

  1. delete all watched variables, breakpoints
  2. flutter clean
  3. VSCode's "Reload Window"

All 23 comments

seems related to #35980

I fixed by

  1. delete all watched variables, breakpoints
  2. flutter clean
  3. VSCode's "Reload Window"

/cc @DanTup

@shrugs I added a comment to the other issue https://github.com/dart-lang/sdk/issues/35980#issuecomment-470436036 about logging. If you can reproduce this and provide the Flutter Run and Observatory logs, that might help understand what happened.

Actually, I saw these errors while looking into https://github.com/Dart-Code/Dart-Code/issues/1507

It seems like we get this error when trying to evaluateInFrame for some frames. It's reproducible with Observatory:

screenshot 2019-03-07 at 2 39 13 pm

The IDE doesn't know which expressions in the Watch window are valid for any given frame, we just have to send them to the VM. However it seems to write these message sometimes when they're not valid.

@DanTup are you reloading when you get this error? If it is a valid error as 'func' probably was removed do you want it to silently ignore the error?

are you reloading when you get this error?

No, no reloading. I was just trying to evaluate the expression at every level of the stack. I expected it to fail on some (where there is no func in scope), however based on the original message at the top here, this is being written to Flutter Run's stdout/stderr rather than only being responded to over the VM Service.

It seems like a similar issue to https://github.com/flutter/flutter/issues/18574 which was fixed by @aam in https://github.com/flutter/flutter/pull/18703. When the debugger is sending expressions to evaluateInFrame, we don't want errors showing up anywhere except in the VM Service call response, since otherwise the console just fills up with errors if they have anything in the watch window (since most expressions are only valid for certain locations of frames).

Ok, I did some more digging. My comment above is slightly incorrect - it's not the same as the previous issue, it does not occur during normal stepping. However, there's definitely something weird going on.

  • Launch flutter_gallery
  • Hit a breakpoint
  • Add an expression foo to the Watch window... it will show an error (only in the Watch window)
  • Remove the expression from the Watch window
  • Full Restart
  • Compiler error about foo appears in Flutter's stdout, despite not being requested at all by the IDE

So it seems like during a Hot Restart, it's compiling expressions that were previously evaluated by the Watch window (evaluateInFrame), and writing all of their errors to stdout. I'm not sure why it's kept hold of those expressions.

Even stranger, is after completely terminating my debug session and starting again, I see errors from expressions evaluated in previous debugging sessions (!).

Might these be being kept around somewhere?

Could these watch expressions be saved on the IDE side? I presume when you say you are terminating your debug session and starting again you don't mean detaching and attaching back to the same engine process but actually starting a brand new session which would be a new engine process.

Could these watch expressions be saved on the IDE side?

I don't believe so - I added and removed the watch expression, and I didn't see anything in the logs to suggest we'd re-sent them to the VM. I'm as confused as you though, I can do some more testing next week.

I presume when you say you are terminating your debug session and starting again you don't mean detaching and attaching back to the same engine process but actually starting a brand new session which would be a new engine process.

That is correct, the app was completely terminated. That's why I wondered if they might be somehow stored somewhere. I'll do more testing, and also see if I can repro using the command line + Observatory too.

@DanTup are you able to repro this with VSCode?

Yep, I can repro in VS Code doing this:

  • Run the flutter_gallery app and hit a breakpoint somewhere
  • Add foo to the watch window
  • Delete foo from the watch window
  • Click the Stop button on the debug toolbar
  • Start a new debug session

I can even restart VS Code, and continue to see them when launching.

@DanTup but what do you observe after Start a new debug session ? I am not seeing anything wrong after I delete foo from watch window, stop, start. What should I be looking for?

I see a load of red text like in the top-most comment here showing that foo is invalid in the Debug Console. It builds up, so after testing a few times, when I next run I see lots and lots of them. When you added foo to your watch window, was it invalid (eg. caused an error in the watch window?), and were you at a breakpoint? I was testing on my MacBook using the iOS simulator.

Note: VS Code 1.32 that was released yesterday has a serious bug that breaks a lot of the Flutter debugger; I don't know whether it effects this (I tested it before the upgrade), but I hope they'll have a fix out for that early next week.

Thanks @DanTup . I got the repro by stopping at a breakpoint, adding a foo watch, removing it, continuing execution, hot reloading. When I hot reload I see foo-related compiler errors showing up in debug console.
I think it's related to https://dart-review.googlesource.com/c/sdk/+/91747 that landed few weeks ago.

cc @jensjoha

16:18:08.544 1601 info flutter.tools [        ] org-dartlang-debug:synthetic_debug_expression:1:1: Error: The getter 'requestList' isn't defined for the class 'FirestoreProvider'.
16:18:08.544 1602 info flutter.tools [        ]  - 'FirestoreProvider' is from 'package:elm_bluetooth_bloc/resources/firestore_provider.dart' ('elm_bluetooth_bloc/lib/resources/firestore_provider.dart').
16:18:08.544 1603 info flutter.tools [        ] Try correcting the name to the name of an existing getter, or defining a getter or field named 'requestList'.
16:18:08.546 1604 info flutter.tools [        ] requestList
16:18:08.546 1605 info flutter.tools [        ] ^^^^^^^^^^^


Doctor summary (to see all details, run flutter doctor -v):
[鈭歖 Flutter (Channel master, v1.3.9-pre.29, on Microsoft Windows [Version 10.0.17134.590], locale en-US)
[鈭歖 Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[鈭歖 Android Studio (version 3.3)
[鈭歖 IntelliJ IDEA Community Edition (version 2017.3)
[鈭歖 VS Code, 32-bit edition (version 1.30.1)
[鈭歖 Connected device (1 available)

I got the same problem. Deleting Breakpoints and variables and restart did not help
After that a flutter clean worked. I get the problem quite often....

Is there a fix for this? It makes hot reloading unreliable. I get the error
"org-dartlang-debug:synthetic_debug_expression ... Error" after a couple of hot reloads in IntelliJ and then the only fix is to do a "flutter clean" and restart.

It seems to happen randomly. The error always refers to code which has just changed but which is correct.

Doctor summary (to see all details, run flutter doctor -v):
[鈭歖 Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.590], locale en-GB)
[鈭歖 Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[鈭歖 Android Studio (version 3.0)
[鈭歖 Android Studio (version 3.1)
[鈭歖 Android Studio (version 3.2)
[鈭歖 IntelliJ IDEA Community Edition (version 2018.3)
[鈭歖 VS Code, 64-bit edition (version 1.30.2)
[鈭歖 Connected device (1 available)

Update. I tried the beta channel and get the same problem. Hot reload works very briefly then I get an "org-dartlang-debug:synthetic_debug_expression" error and need to run "Flutter clean" to get going again.

https://dart-review.googlesource.com/c/sdk/+/96406 with the fix. It should land into dart sdk first, which then should be rolled into the engine/flutter.

seems related to #35980

I fixed by

  1. delete all watched variables, breakpoints
  2. flutter clean
  3. VSCode's "Reload Window"

good job

Mp5A5, that doesn't help me much.

Using IntelliJ the error re-appears after a small and apparently random number of hot reloads. It's a very slow cycle to keep running "flutter clean" and then rebuild and rerun the code.

The CL has been rolled into Flutter, can this issue be closed

https://dart-review.googlesource.com/c/sdk/+/96406 with the fix. It should land into dart sdk first,
which then should be rolled into the engine/flutter.

How do I update flutter to use this fix?

The CL has been rolled into Flutter, can this issue be closed

@a-siva What is the ETA to get an update on Flutter with this?

Was this page helpful?
0 / 5 - 0 ratings