flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.58k stars 326 forks source link

Showing only the [root] not jumping back to source when clicking any widget from detailed view #3153

Closed NishantSinghh closed 2 months ago

NishantSinghh commented 3 years ago

Hi,

I am using flutter 1.24.0-10.2.pre for a web based application trying to use the locators using flutter inspector but when trying to find the details and want to go back to source its not working. Only the [root] is displaying and in detailed view when clicking on any widget I am not navigating back to the source code. Please help.

Screenshot 2021-06-22 at 5 09 22 PM
kenzieschmoll commented 3 years ago

Can you try to upgrade your flutter to the latest stable 2.2.2?

CC @jacob314

NishantSinghh commented 3 years ago

@kenzieschmoll Thanks for reply but I can't upgrade the flutter. So need to have some solutions if its possible with the same version.

kenzieschmoll commented 3 years ago

Can you open DevTools in the browser and see if there are any errors in the Chrome dev console?

NishantSinghh commented 3 years ago

@kenzieschmoll Thanks for the suggestion and I have tried using DevTools on browser So here are my observation On Android Studio IDE

  1. When ran the application directly using command "flutter run -d chrome" I am able to view the expected tree widget instead of only [root]
  2. When ran the application using the "Run" button on android studio getting the same only [root] object on the inspector view and as suggested by @kenzieschmoll there are error on Chrome dev console as well Unrecognized error: evaluate: (-32603) evaluate: Unexpected error from chrome devtools: text: Uncaught exception: description: SyntaxError: Unexpected token '(' type: object value: null attempted JS eval: \(function() { var sdkUtils = require('dart_sdk').dart; var library = sdkUtils.getLibrary('package:flutter/src/widgets/widget_inspector.dart'); if (!library) throw 'cannot find library for package:flutter/src/widgets/widget_inspector.dart'; .....`

Workaround used VS code editor in VS code editor flutter inspector working perfectly fine.

jacob314 commented 3 years ago

Fyi @annagrin it appears something has regressed in eval and evaluating the large expression for the inspector is now triggering a JavaScript syntax error.

annagrin commented 3 years ago

@jacob314 @kenzieschmoll @NishantSinghh Flutter inspector needs support for VMService.evaluate() API that the web debugger only started supporting in the version demonstrated at google.io - I believe it is Flutter 2.2.

Correction - above is only true for the LayoutExplorer, the tree layout should work, my mistake. Looks like the error is only happening in Android studio, so its flutter extension might be calling VMService.evaluate() and not catching its errors. Not sure about a workaround without updating flutter - @devoncarew what do you think?

The good news is that it should also be fixed by Flutter 2.2.

kenzieschmoll commented 2 months ago

Closing as obsolete.