Skip to content

[tool_crash] RpcException from widget-preview #185657

Closed

Description

@helin24

Command

flutter --no-color widget-preview start --web-server --machine --verbose --dtd-url=ws://127.0.0.1:61678/cO1hZcm8Lbc= --devtools-server-address=http://127.0.0.1:9100/?ide=IntelliJ-IDEA

Steps to Reproduce

  1. This is from opening the widget preview tool window in IntelliJ.

Logs

RpcException

package:json_rpc_2/src/client.dart 134:62                            Client.sendRequest
package:json_rpc_2/src/peer.dart 116:15                              Peer.sendRequest
package:dtd/src/dart_tooling_daemon.dart 218:36                      DartToolingDaemon.call
package:flutter_tools/src/widget_preview/dtd_services.dart 176:48    WidgetPreviewDtdServices.getFlutterWidgetPreviews
===== asynchronous gap ===========================
package:flutter_tools/src/commands/widget_preview.dart 418:54        WidgetPreviewStartCommand.runCommand
===== asynchronous gap ===========================
package:flutter_tools/src/runner/flutter_command.dart 1630:27        FlutterCommand.run.<fn>
===== asynchronous gap ===========================
package:flutter_tools/src/base/context.dart 154:19                   AppContext.run.<fn>
===== asynchronous gap ===========================
package:args/command_runner.dart 212:13                              CommandRunner.runCommand
===== asynchronous gap ===========================
package:flutter_tools/src/runner/flutter_command_runner.dart 496:9   FlutterCommandRunner.runCommand.<fn>
===== asynchronous gap ===========================
package:flutter_tools/src/base/context.dart 154:19                   AppContext.run.<fn>
===== asynchronous gap ===========================
package:flutter_tools/src/runner/flutter_command_runner.dart 431:5   FlutterCommandRunner.runCommand
===== asynchronous gap ===========================
package:flutter_tools/src/runner/flutter_command_runner.dart 307:33  FlutterCommandRunner.run.<fn>
===== asynchronous gap ===========================
package:flutter_tools/runner.dart 104:11                             run.<fn>.<fn>
===== asynchronous gap ===========================
package:flutter_tools/src/base/context.dart 154:19                   AppContext.run.<fn>
===== asynchronous gap ===========================
[!] Flutter (Channel [user-branch], 3.44.0-0.2.pre, on macOS 15.7.5 24G624 darwin-arm64, locale en-US) [2.1s]
    ! Flutter version 3.44.0-0.2.pre on channel [user-branch] at /Users/helinx/Documents/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision 8dc49c65cc (12 days ago), 2026-04-15 22:34:13 -0700
    • Engine revision 86ee39d259
    • Dart version 3.12.0 (build 3.12.0-327.3.beta)
    • DevTools version 2.57.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration, enable-riscv64
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0-rc1) [2.4s]
    • Android SDK at /Users/helinx/Library/Android/sdk
    • Emulator version 36.5.3.0 (build_id 14849922) (CL:N/A)
    ✗ cmdline-tools component is missing.
      Try installing or updating Android Studio.
      Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment variable.
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/macos-android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [2.9s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16E140
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [5ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (3 available) [5.8s]
    • iPhone 16 Plus (mobile) • DC8F4FD5-7311-4CE2-B7B3-CDBE409652B7 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-4 (simulator)
    • macOS (desktop)         • macos                                • darwin-arm64   • macOS 15.7.5 24G624 darwin-arm64
    • Chrome (web)            • chrome                               • web-javascript • Google Chrome 147.0.7727.102

[✓] Network resources [664ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Flutter Application Metadata

Type: malformed
Version: 0.0.1
Material: true
Android X: false
Module: false
Plugin: false
Android package: null
iOS bundle identifier: null
Creation channel: null
Creation framework version: null

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Apr 27, 2026
  2. bkonyi commented on Apr 30, 2026

    @bkonyi
    Contributor

    Is there an error message associated with the exception? It could be that the DTD connection is disappearing.

  3. bkonyi commented on Apr 30, 2026

    @bkonyi
    Contributor

    This looks related to #185299, which should be in the next beta release.

  4. helin24 commented on Apr 30, 2026

    @helin24
    MemberAuthor

    Thanks! I should be able to test it out.

  5. helin24 commented on Apr 30, 2026

    @helin24
    MemberAuthor

    I think this error is still happening. I sent you logs from the plugin, but now I'm also noticing this message from analysis server:

    1777570946199:Ex:Failed to handle request:: lsp.handle
    type 'LegacyAnalysisServer' is not a subtype of type 'LspAnalysisServer' in type cast
    #0      WorkspaceFlutterWidgetPreviewsHandler.handle (package::analysis_server/src/lsp/handlers/custom/handler_get_widget_previews.dart::117)
    #1      MessageHandler.handleMessage (package::analysis_server/src/lsp/handlers/handlers.dart::433)
    #2      ServerStateMessageHandler.handleMessage (package::analysis_server/src/lsp/handlers/handlers.dart::515)
    #3      AnalysisServer.immediatelyHandleLspMessage (package::analysis_server/src/analysis_server.dart::878)
    #4      DtdServices.processMessage (package::analysis_server/src/services/dart_tooling_daemon/dtd_services.dart::85)
    #5      MessageScheduler.processMessages (package::analysis_server/src/scheduler/message_scheduler.dart::234)
    #6      new Future.delayed.<anonymous closure> (dart::async/future.dart::440)
    #7      _rootRun (dart::async/zone_root.dart::27)
    #8      _CustomZone.run (dart::async/zone.dart::726)
    #9      _CustomZone.runGuarded (dart::async/zone.dart::625)
    #10     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart::async/zone.dart::666)
    #11     _rootRun (dart::async/zone_root.dart::35)
    #12     _CustomZone.run (dart::async/zone.dart::726)
    #13     _CustomZone.bindCallback.<anonymous closure> (dart::async/zone.dart::649)
    #14     Timer._createTimer.<anonymous closure> (dart::async-patch/timer_patch.dart::18)
    #15     _Timer._runTimers (dart::isolate-patch/timer_impl.dart::423)
    #16     _Timer._handleMessage (dart::isolate-patch/timer_impl.dart::454)
    #17     _RawReceivePort._handleMessage (dart::isolate-patch/isolate_patch.dart::192)
    

    Perhaps this means something has changed about an analysis server request?

  6. bkonyi commented on May 1, 2026

    @bkonyi
    Contributor

    This should be resolved now that 521b102 has landed. I'm going to CP this into beta so it's part of the next stable release.

  7. helin24 commented on May 1, 2026

    @helin24
    MemberAuthor

    I confirmed this is fixed when I pull flutter master. Thanks!

  8. github-actions commented on May 15, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    team-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions