Skip to content
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

Exception when opening DevTools in VS Code #8704

Open
kenzieschmoll opened this issue Jan 14, 2025 · 3 comments
Open

Exception when opening DevTools in VS Code #8704

kenzieschmoll opened this issue Jan 14, 2025 · 3 comments
Labels
ide: vs-code ide-integration P2 important to work on, but not at the top of the work list. property editor

Comments

@kenzieschmoll
Copy link
Member

 [zoneGuarded]: TypeError: null: type 'minified:Wz' is not a subtype of type 'Map<String, Object?>'
org-dartlang-sdk:///dart-sdk/lib/_internal/js_runtime/lib/js_helper.dart 1209:19  wrapException
org-dartlang-sdk:///dart-sdk/lib/_internal/js_shared/lib/rti.dart 1577:3          _failedAsCheck
org-dartlang-sdk:///dart-sdk/lib/_internal/js_shared/lib/rti.dart 1554:3          _generalAsCheckImplementation
../../../lib/src/service/editor/api_classes.dart 310:35                           EditorClient._initialize.<anonymous function>
org-dartlang-sdk:///dart-sdk/lib/async/zone.dart 1538:46                          _rootRunUnary
org-dartlang-sdk:///dart-sdk/lib/async/zone.dart 1428:34                          _CustomZone.runUnary
org-dartlang-sdk:///dart-sdk/lib/async/zone.dart 1329:7                           _CustomZone.runUnaryGuarded
org-dartlang-sdk:///dart-sdk/lib/async/stream_impl.dart 381:5                     _BufferingStreamSubscription._sendData
org-dartlang-sdk:///dart-sdk/lib/async/stream_impl.dart 573:5                     _DelayedData.perform

Looks like a null error in ActiveLocationChangedEvent: https://github.com/flutter/devtools/blob/master/packages/devtools_app/lib/src/service/editor/api_classes.dart/#L310

Flutter 3.28.0-2.0.pre.38699 • channel [user-branch] • unknown source
Framework • revision d14140f854 (27 hours ago) • 2025-01-13 10:20:40 +1300
Engine • revision d14140f854
Tools • Dart 3.7.0 (build 3.7.0-312.0.dev) • DevTools 2.42.0

My vscode settings:

    // Required for the Property Editor.
    "dart.previewDtdLspIntegration": true,
    "dart.experimentalDtdHandlers": true,
    "dart.experimentalPropertyEditor": true,
    // Optional, ensures that when a property is edited a hot-reload is triggered.
    "dart.flutterHotReloadOnSave": "all",

@DanTup @elliette

@kenzieschmoll
Copy link
Member Author

Confirmed this exception does not occur when I commented out the vs code settings to enable the experimental property editor

@DanTup
Copy link
Contributor

DanTup commented Jan 14, 2025

Yeah, looks like a bug in the code linked above. In https://dart-review.googlesource.com/c/sdk/+/392908 we made textDocument nullable (it may have been done after the DevTools code was created?):

  /// An identifier that represents a specific version of a specific document.
  ///
  /// `null` is there is no active document.
  VersionedTextDocumentIdentifier? textDocument;

But in the DevTools code it's not:

@elliette null is valid here if the active editor is removed - for example if the user closes the last open file they had. Probably the property editor should show some kind of message (like "open a file to use the property editor").

@elliette elliette added the P2 important to work on, but not at the top of the work list. label Jan 14, 2025
@elliette
Copy link
Member

Thanks for bringing this to my attention! Will send out a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide: vs-code ide-integration P2 important to work on, but not at the top of the work list. property editor
Projects
None yet
Development

No branches or pull requests

3 participants