flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.97k stars 316 forks source link

The following TypeErrorImpl was thrown during a service extension callback for "ext.flutter.inspector.getRootWidgetSummaryTree" #5815

Open franbonafina opened 2 years ago

franbonafina commented 2 years ago

Step to Reproduce

Dispatching an event (5 times/ 3 second) from a Widget which change State of aStatefulWidget generate a crash in the app.

Flutter Performance

image

Log

======== Exception caught by Flutter framework =====================================================
The following TypeErrorImpl was thrown during a service extension callback for "ext.flutter.inspector.getRootWidgetSummaryTree":
Unexpected null value.

When the exception was thrown, this was the stack: 
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49      throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 528:63  nullCheck
packages/flutter/src/widgets/widget_inspector.dart 798:84                         <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
packages/flutter/src/widgets/widget_inspector.dart 797:38                         <fn>
packages/flutter/src/foundation/binding.dart 604:32                               <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                <fn>
dart-sdk/lib/async/zone.dart 1687:54                                              runUnary
dart-sdk/lib/async/future_impl.dart 160:18                                        handleValue
dart-sdk/lib/async/future_impl.dart 767:44                                        handleValueCallback
dart-sdk/lib/async/future_impl.dart 796:13                                        _propagateToListeners
dart-sdk/lib/async/future_impl.dart 593:7                                         [_complete]
dart-sdk/lib/async/future.dart 312:15                                             <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19           internalCallback
====================================================================================================

Version info

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.2, on macOS 11.6 20G165 darwin-x64, locale en-PR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.2)
[✓] Connected device (1 available)
stevemessick commented 2 years ago

@kenzieschmoll Is this a DevTools issue?

kenzieschmoll commented 2 years ago

If this exception came from interacting with the Performance tool window in IntelliJ (pictured), then I don't think so. Does the flutter-intelliJ plugin call the ext.flutter.inspector.getRootWidgetSummaryTree anywhere? If it does not, then this could be being triggered from DevTools. I would have expected the stack trace to contain some devtools information if that was the case, but maybe DevTools stack frames arent surfaced in any error from IntelliJ - I'm not sure.

stevemessick commented 2 years ago

Thanks @kenzieschmoll ! Yes, that service extension is used by the built-in inspector.