You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report. I couldn't reproduce this on macOS (Flutter 3.44.0) — flutter widget-preview start on a clean flutter create --template=package project starts fine, with the analysis server registering the LSP service and reaching "Done loading previews". The -32601 Unknown method "…getFlutterWidgetPreviews" means the analysis server on your machine isn't exposing that LSP method, which usually points to a Dart SDK / analysis-server version mismatch rather than the project itself.
To narrow it down, could you share:
Your full flutter doctor -v
The verbose log: flutter widget-preview start -v (this shows whether the analysis server registers the LSP service and which SDK versions are in play)
Whether you have a separate Dart SDK on your PATH (vs. the one bundled with this Flutter)
Also, does it reproduce on a brand-new flutter create --template=package project? That'll help confirm whether it's Windows-specific or an SDK-state issue on your machine.
Just to clarify, I didn't write this issue manually. Flutter itself suggested filing it in the terminal after the command failed. I simply confirmed and submitted it.
The issue reproduces on my Windows machine in a corporate environment. I'll add the requested information (flutter doctor -v output and the verbose log) tomorrow.
[√] Flutter (Channel stable, 3.44.0, on Microsoft Windows [Version 10.0.26100.6584], locale en-US)
[√] Windows Version (Windows 11 or higher, 24H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 37.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.19)
[√] Connected device (4 available)
[√] Network resources
• No issues found!
flutter widget-preview start -v
The verbose log is attached above (the original report). Key observations from it:
Flutter 3.44.0, stable channel, Windows 11 24H2
The DTD connects and registers its services successfully (Connected to DTD and registered services)
Analysis server sends a $/progressANALYZING → end event, meaning it does start up
The crash fires immediately after with: JSON-RPC error -32601 (method not found): Unknown method "Lsp.dart/workspace/getFlutterWidgetPreviews"
A crash report was sent to Google (report ID: 77cd65d419280f17)
[ +17 ms] Registered DTD method: hotRestartPreviewer
[ ] Registered DTD method: isWindows
[ ] Registered DTD method: resolveUri
[ +1 ms] Registered DTD method: setPreference
[ ] Registered DTD method: getPreference
[ ] Registered DTD method: getDevToolsUri
[ ] Connected to DTD and registered services.
[ +867 ms] "flutter start" took 4,596ms.
[ +92 ms] Sending crash report to Google.
[ +992 ms] Crash report sent (report ID: 77cd65d419280f17)
[ ] Oops; flutter has exited unexpectedly: "JSON-RPC error -32601
(method not
found): Unknown method
"Lsp.dart/workspace/getFlutterWidgetPreviews".".
[ +7 ms] executing: C:\Program Files\Android\Android Studio1\jbr\bin\java
-version
[ +74 ms] Exit code 0 from: C:\Program Files\Android\Android
Studio1\jbr\bin\java -version
[ ] openjdk version "21.0.10" 2026-01-20
OpenJDK Runtime Environment (build 21.0.10+-14961533-b1163.108)
OpenJDK 64-Bit Server VM (build 21.0.10+-14961533-b1163.108, mixed
mode)
[ +108 ms] executing: [C:\DEV\flutter/] git -c log.showSignature=false log -n
1 --pretty=format:%ar
[ +36 ms] Exit code 0 from: git -c log.showSignature=false log -n 1
--pretty=format:%ar
[ ] 3 weeks ago
[ +11 ms] executing: C:\Program Files (x86)\Microsoft Visual
Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version
16 -requires Microsoft.VisualStudio.Workload.NativeDesktop
Microsoft.VisualStudio.Component.VC.Tools.x86.x64
Microsoft.VisualStudio.Component.VC.CMake.Project
[ +29 ms] Exit code 0 from: C:\Program Files (x86)\Microsoft Visual
Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version
16 -requires Microsoft.VisualStudio.Workload.NativeDesktop
Microsoft.VisualStudio.Component.VC.Tools.x86.x64
Microsoft.VisualStudio.Component.VC.CMake.Project
[ ] [
{
"instanceId": "79e3a001",
"installDate": "2025-09-23T11:21:21Z",
"installationName": "VisualStudio/17.14.19+36623.8",
"installationPath": "C:\\Program Files\\Microsoft Visual
Studio\\2022\\Community",
"installationVersion": "17.14.36623.8",
"productId": "Microsoft.VisualStudio.Product.Community",
"productPath": "C:\\Program Files\\Microsoft Visual
Studio\\2022\\Community\\Common7\\IDE\\devenv.exe",
"state": 4294967295,
"isComplete": true,
"isLaunchable": true,
"isPrerelease": false,
"isRebootRequired": false,
"displayName": "Visual Studio Community 2022",
"description": "Powerful IDE, free for students, open-source
contributors, and individuals",
"channelId": "VisualStudio.17.Release",
"channelUri": "https://aka.ms/vs/17/release/channel",
"enginePath": "C:\\Program Files (x86)\\Microsoft Visual
Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Micros
oft.VisualStudio.Setup.Service",
"installedChannelId": "VisualStudio.17.Release",
"installedChannelUri": "https://aka.ms/vs/17/release/channel",
"releaseNotes":
"https://docs.microsoft.com/en-us/visualstudio/releases/2022/re
lease-notes-v17.14#17.14.19",
"resolvedInstallationPath": "C:\\Program Files\\Microsoft
Visual Studio\\2022\\Community",
"thirdPartyNotices":
"https://go.microsoft.com/fwlink/?LinkId=661288",
"updateDate": "2025-11-08T11:14:49.57698Z",
"catalog": {
"buildBranch": "d17.14",
"buildVersion": "17.14.36623.8",
"id": "VisualStudio/17.14.19+36623.8",
"localBuild": "build-lab",
"manifestName": "VisualStudio",
"manifestType": "installer",
"productDisplayVersion": "17.14.19",
"productLine": "Dev17",
"productLineVersion": "2022",
"productMilestone": "RTW",
"productMilestoneIsPreRelease": "False",
"productName": "Visual Studio",
"productPatchVersion": "19",
"productPreReleaseMilestoneSuffix": "1.0",
"productSemanticVersion": "17.14.19+36623.8",
"requiredEngineVersion": "3.14.2086.54749"
},
"properties": {
"campaignId": "2030:a38bb1c2cd4e49748113568186377c45",
"canceled": "0",
"channelManifestId":
"VisualStudio.17.Release/17.14.19+36623.8",
"includeRecommended": "1",
"nickname": "",
"setupEngineFilePath": "C:\\Program Files (x86)\\Microsoft
Visual Studio\\Installer\\setup.exe"
}
}
]
[ +3 ms] executing: reg query
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0
/v InstallationFolder
[ +17 ms] Exit code 0 from: reg query
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0
/v InstallationFolder
[ ] HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft
SDKs\Windows\v10.0
InstallationFolder REG_SZ C:\Program Files (x86)\Windows
Kits\10\
[ +2 ms] executing:
C:\Users\83\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[ +3 ms] Failed to get Caption and OSArchitecture from WMI:
ProcessException: Failed to find "wmic" in the search path.
Command: wmic
[ +65 ms] List of devices attached
emulator-5554 device product:sdk_gphone16k_x86_64
model:sdk_gphone16k_x86_64 device:emu64xa16k transport_id:2
[ +4 ms] C:\Users\83\AppData\Local\Android\sdk\platform-tools\adb.exe -s
emulator-5554 shell getprop
[ +41 ms] executing: C:\Program Files\Eclipse
Adoptium\jdk-17.0.19.10-hotspot\bin\java --version
[ +69 ms] Exit code 0 from: C:\Program Files\Eclipse
Adoptium\jdk-17.0.19.10-hotspot\bin\java --version
[ ] openjdk 17.0.19 2026-04-21
OpenJDK Runtime Environment Temurin-17.0.19+10 (build 17.0.19+10)
OpenJDK 64-Bit Server VM Temurin-17.0.19+10 (build 17.0.19+10,
mixed mode, sharing)
[ +5 ms] ro.hardware = ranchu
[ +26 ms] executing:
C:\Users\83\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[ +26 ms] List of devices attached
emulator-5554 device product:sdk_gphone16k_x86_64
model:sdk_gphone16k_x86_64 device:emu64xa16k transport_id:2
[ +868 ms] <==
{"jsonrpc":"2.0","method":"$/progress","params":{"token":"ANALYZING","value":{
"kind":"end"}}}
[ +194 ms] A crash report has been written to
C:\Users\83\AppData\Local\Temp\flutter_tools.dfd01b7b\widget_preview_scaffold5
e1a6404\flutter_01.log
[ ] This crash may already be reported. Check GitHub for similar
crashes.
[ ]
https://github.com/flutter/flutter/issues?q=is%3Aissue+JSON-RPC+error+-32601+%
28method+not+found%29%3A+Unknown+method+%22Lsp.dart%2Fworkspace%2FgetFlutterWi
dgetPreviews%22.
[ ] To report your crash to the Flutter team, first read the guide to
filing a
bug.
[ ] https://flutter.dev/to/report-bugs
[ ] Create a new GitHub issue by pasting this link into your browser
and
completing the issue template. Thank you!
[ +5 ms] No .metadata file found at
C:\Users\83\AppData\Local\Temp\flutter_tools.dfd01b7b\widget_preview_scaffold5
e1a6404\.metadata.
Dart SDK situation
I do not have a separate Dart SDK on my PATH — I'm using only the Dart SDK bundled with this Flutter install.
After more testing, the command actually works correctly on a clean flutter create --template=package project. So this isn't a Windows-specific bug or an SDK version mismatch.
The real issue was my own mistake: I was running flutter widget-preview start from the package root (E:\Projects\Flutter Packages\BCM — a Flutter package, not a full app), instead of from the example/ directory where the actual app lives.
The tool connects to DTD successfully, then calls Lsp.dart/workspace/getFlutterWidgetPreviews on a workspace that isn't set up as a widget-preview app — so it crashes with -32601 method not found. Running the same command from example/ works fine.
Fix:
cd "E:\Projects\Flutter Packages\BCM\example"
flutter widget-preview start
That said — while this was my mistake, it does seem like flutter widget-preview start should detect that it's being run from an invalid project context and show a clear, actionable error message (e.g. "This directory is not a Flutter app. Did you mean to run this from your example/ folder?") rather than crashing with a raw JSON-RPC error and sending a crash report to Google. The current failure mode is pretty opaque for something that could be caught early. Might be worth a separate issue or UX improvement request.
@Nullexdev Thanks for reporting the issue. I tested this on the latest master channel, and I was able to reproduce it.
Findings:
The error occurs specifically when running the flutter widget-preview start command directly from PowerShell. However, when opening the folder in VS Code and running the exact same command from there, everything works perfectly fine.
LOGS:
Creating widget preview scaffolding at:C:\Google\repro_preview_issue\.widget_preview
Creating the WidgetPreviewScaffold manifest at C:\Google\repro_preview_issue\.widget_preview\preview_manifest.json
Launching analysis server...
Connecting to DTDConnected to DTDFailed to retrieve widget previews from the DartToolingDaemon (DTD). Ensure that the analysis server is running and reachable. Details:JSON-RPC error -32601 (method not
found):Unknown method "Lsp.dart/workspace/getFlutterWidgetPreviews".
Steps to repro:
flutter create --template=package repro_preview
cd repro_preview
flutter widget-preview start
@Nullexdev could you please confirm if I followed any steps incorrectly?
Yes, I can confirm your steps are correct and the issue reproduces.
However, I also found the root cause in my case: I was running flutter widget-preview start from the package root (which is a Flutter package, not a full app). Running it from the example/ directory works correctly.
So in my situation, the crash happens when running the command from a directory that isn't a Flutter app. It seems the tool doesn't validate the project type before attempting to connect — it just crashes with a raw JSON-RPC error instead of giving a helpful message like "This directory is not a Flutter app."
I tested from Git Bash, PowerShell, and the VS Code terminal, running the command from the example/ directory — the same error occurs regardless of where I run it from.
flutter widget-preview start fails with the same error.
Notably, running
cd ~/workspaceRoot/apps/app1 && flutter widget-preview startalso fails. I wonder if that's because the IDE's context is set to ~/workspaceRoot regardless of the context of the terminal?
EDIT: Even setting up a new workspace for the app on its own doesn't fix it. Even tried running flutter clean etc and killing the processes.
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.
Activity
mbcorona commentedon Jun 2, 2026
Thanks for the report. I couldn't reproduce this on macOS (Flutter 3.44.0) — flutter widget-preview start on a clean flutter create --template=package project starts fine, with the analysis server registering the LSP service and reaching "Done loading previews". The -32601 Unknown method "…getFlutterWidgetPreviews" means the analysis server on your machine isn't exposing that LSP method, which usually points to a Dart SDK / analysis-server version mismatch rather than the project itself.
To narrow it down, could you share:
Your full flutter doctor -v
The verbose log: flutter widget-preview start -v (this shows whether the analysis server registers the LSP service and which SDK versions are in play)
Whether you have a separate Dart SDK on your PATH (vs. the one bundled with this Flutter)
Also, does it reproduce on a brand-new flutter create --template=package project? That'll help confirm whether it's Windows-specific or an SDK-state issue on your machine.
Alimmzdev commentedon Jun 2, 2026
Hi @mbcorona ,
Thanks for the quick follow-up!
Just to clarify, I didn't write this issue manually. Flutter itself suggested filing it in the terminal after the command failed. I simply confirmed and submitted it.
The issue reproduces on my Windows machine in a corporate environment. I'll add the requested information (
flutter doctor -voutput and the verbose log) tomorrow.Thanks for your patience!
Alimmzdev commentedon Jun 3, 2026
@mbcorona
flutter doctor -v
flutter widget-preview start -v
The verbose log is attached above (the original report). Key observations from it:
Connected to DTD and registered services)$/progressANALYZING → endevent, meaning it does start upJSON-RPC error -32601 (method not found): Unknown method "Lsp.dart/workspace/getFlutterWidgetPreviews"77cd65d419280f17)Dart SDK situation
I do not have a separate Dart SDK on my PATH — I'm using only the Dart SDK bundled with this Flutter install.
flutter doctor -v
Reproduction on a clean project
After further testing, this does not reproduce on a brand-new
flutter create --template=packageproject — the command works fine there.Alimmzdev commentedon Jun 3, 2026
Update — Root cause found
After more testing, the command actually works correctly on a clean
flutter create --template=packageproject. So this isn't a Windows-specific bug or an SDK version mismatch.The real issue was my own mistake: I was running
flutter widget-preview startfrom the package root (E:\Projects\Flutter Packages\BCM— a Flutter package, not a full app), instead of from theexample/directory where the actual app lives.The tool connects to DTD successfully, then calls
Lsp.dart/workspace/getFlutterWidgetPreviewson a workspace that isn't set up as a widget-preview app — so it crashes with-32601 method not found. Running the same command fromexample/works fine.Fix:
That said — while this was my mistake, it does seem like
flutter widget-preview startshould detect that it's being run from an invalid project context and show a clear, actionable error message (e.g. "This directory is not a Flutter app. Did you mean to run this from your example/ folder?") rather than crashing with a raw JSON-RPC error and sending a crash report to Google. The current failure mode is pretty opaque for something that could be caught early. Might be worth a separate issue or UX improvement request.Alimmzdev commentedon Jun 3, 2026
Sorry, I accidentally closed this issue. I'm available if you need any further information or logs to investigate.
puneetkukreja98 commentedon Jun 3, 2026
@Nullexdev Thanks for reporting the issue. I tested this on the latest master channel, and I was able to reproduce it.
Findings:
The error occurs specifically when running the flutter widget-preview start command directly from PowerShell. However, when opening the folder in VS Code and running the exact same command from there, everything works perfectly fine.
LOGS:
Steps to repro:
@Nullexdev could you please confirm if I followed any steps incorrectly?
2 remaining items
puneetkukreja98 commentedon Jun 3, 2026
similar issue #185657
Alimmzdev commentedon Jun 3, 2026
@puneetkukreja98
Yes, I can confirm your steps are correct and the issue reproduces.
However, I also found the root cause in my case: I was running
flutter widget-preview startfrom the package root (which is a Flutter package, not a full app). Running it from theexample/directory works correctly.So in my situation, the crash happens when running the command from a directory that isn't a Flutter app. It seems the tool doesn't validate the project type before attempting to connect — it just crashes with a raw JSON-RPC error instead of giving a helpful message like "This directory is not a Flutter app."
I tested from Git Bash, PowerShell, and the VS Code terminal, running the command from the
example/directory — the same error occurs regardless of where I run it from.ThomasDuffinMears commentedon Jun 18, 2026
Feels related to the limitation mentioned here (linked in the docs): #173550.
We have a monorepo setup like so 👇
. └── workspaceRoot ├── apps │ ├── app1 │ │ └── lib/main.dart │ └── ... ├── packages │ └── ... └── scripts └── ...Which explains why running
flutter widget-preview startfails with the same error.Notably, running
cd ~/workspaceRoot/apps/app1 && flutter widget-preview startalso fails. I wonder if that's because the IDE's context is set to~/workspaceRootregardless of the context of the terminal?EDIT: Even setting up a new workspace for the app on its own doesn't fix it. Even tried running flutter clean etc and killing the processes.
[Tool] Fix widget-preview crash by waiting for analysis server (flutt…
[Tool] Fix widget-preview crash by waiting for analysis server (flutt…
github-actions commentedon Jul 14, 2026
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 -vand a minimal reproduction of the issue.