Skip to content

"flutter attach" fails for web: "_createDevFS: (-32601) Unknown method "_createDevFS" #149258

@DanTup

Description

@DanTup

Steps to reproduce

If I start an application from one terminal using flutter run -d windows and then in another terminal I use flutter attach --machine to attach to it, I see no errors and flutter attach correctly outputs an app.started event. This event is what VS Code/DAP use to communicate with Flutter when attaching.

Screenshot 2024-05-29 175205

If I repeat the same steps but using the Chrome device, then I see an error "_createDevFS: (-32601) Unknown method "_createDevFS" and no app.started event is emitted, instead you get an "app.stop" with an error (note: you can repro this without the --machine and you'll just see the message written to the console, but it's less obvious what the IDE is setting).

Screenshot 2024-05-29 175247

The full stack looks like:

#0      new _OutstandingRequest (package:vm_service/src/vm_service.dart:265:34)
#1      VmService._call.<anonymous closure> (package:vm_service/src/vm_service.dart:1775:25)
#2      VmService._call (package:vm_service/src/vm_service.dart:1787:8)
#3      VmService.callServiceExtension (package:vm_service/src/vm_service.dart:1733:14)
#4      FlutterVmService.createDevFS (package:flutter_tools/src/vmservice.dart:1065:20)
#5      DevFS.create (package:flutter_tools/src/devfs.dart:516:61)
#6      FlutterDevice.setupDevFS (package:flutter_tools/src/resident_runner.dart:396:19)
#7      HotRunner._initDevFS (package:flutter_tools/src/run_hot.dart:482:23)
#8      HotRunner.attach (package:flutter_tools/src/run_hot.dart:272:41)
<asynchronous suspension>
#9      AppDomain.launch.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:815:9)
<asynchronous suspension>
#10     AppDomain.launch (package:flutter_tools/src/commands/daemon.dart:813:5)
<asynchronous suspension>
#11     AttachCommand._attachToDevice (package:flutter_tools/src/commands/attach.dart:356:17)
<asynchronous suspension>
#12     AttachCommand.runCommand (package:flutter_tools/src/commands/attach.dart:265:5)

I'm not certain if using attach like this is supported, though it's how some of the integration tests work (and I'd expect behaviour to be similar between web/VM).

Expected results

Attaching to Chrome should behave the same as attaching to a VM.

Actual results

Attaching to Chrome fails with an error.

Code sample

This can be reproduced just using a simple flutter create app.

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
PS C:\Dev\Test Projects\flutter_counter> flutter doctor -v
[!] Flutter (Channel [user-branch], 3.23.0-13.0.pre.5, on Microsoft Windows [Version 10.0.22631.3593], locale en-GB)
    ! Flutter version 3.23.0-13.0.pre.5 on channel [user-branch] at C:\Dev\Google\Flutter\Flutter main
      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/docs/get-started/install.
    • Upstream repository [email protected]:DanTup/flutter.git
    • FLUTTER_GIT_URL = [email protected]:DanTup/flutter.git
    • Framework revision 76abb6467c (34 minutes ago), 2024-05-29 17:28:30 +0100
    • Engine revision 30aa720d49
    • Dart version 3.5.0 (build 3.5.0-191.0.dev)
    • DevTools version 2.36.0-dev.10
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\danny\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.7.34031.279
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] VS Code (version 1.89.1)
    • VS Code at C:\Users\danny\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.91.20240529

[√] VS Code (version 1.90.0-insider)
    • VS Code at C:\Users\danny\AppData\Local\Programs\Microsoft VS Code Insiders
    • Flutter extension version 3.89.20240501

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.3593]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 125.0.6422.112
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 125.0.2535.51

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consolefound in release: 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyplatform-windowsBuilding on or for Windows specificallyteam-webOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions