Repository navigation
[widget previews] workspaces with nested projects (like examples) don't work #176018
Copy link
Copy link
Closed
Closed
Copy link
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: widget previewsIssues related to the Widget Previewer toolingIssues related to the Widget Previewer toolingfound in release: 3.35Found to occur in 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37Found to occur in 3.37has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
Steps to reproduce
git clone https://github.com/benthillerkus/widget-preview-repro-workspaces.git- check out the
nestedbranch flutter pub getflutter widget-preview start
Expected results
The widget preview opens.
Actual results
The command errors out (see logs).
Code sample
https://github.com/benthillerkus/widget-preview-repro-workspaces
Screenshots or Video
No response
Logs
Logs
❯ puro flutter widget-preview start
Creating widget preview scaffolding at: /Users/bent/Projects/widget-preview-repro-workspaces/.dart_tool/widget_preview_scaffold
Creating the Widget Preview Scaffold manifest at /Users/bent/Projects/widget-preview-repro-workspaces/.dart_tool/widget_preview_scaffold/preview_manifest.json
Because every version of example from path depends on asdf from hosted and widget_preview_scaffold depends on asdf from path, example from path is forbidden.
So, because widget_preview_scaffold depends on example from path, version solving failed.
Failed to update packages.Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.35.4, on macOS 26.1 25B5042k darwin-arm64, locale en-DE) [713ms]
• Flutter version 3.35.4 on channel stable at /Users/bent/.puro/envs/3.35.4/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d693b4b9db (9 days ago), 2025-09-16 14:27:41 +0000
• Engine revision c298091351
• Dart version 3.9.2
• DevTools version 2.48.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [3.0s]
• Android SDK at /Users/bent/Library/Android/sdk
• Emulator version unknown
• Platform android-36, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.6+-13391695-b895.109)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 26.0.1) [908ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17A400
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods.
For re-installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation
[✓] Chrome - develop for the web [14ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2025.1) [14ms]
• Android Studio at /Applications/Android Studio.app/Contents
• 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 21.0.6+-13391695-b895.109)
[✓] VS Code (version 1.104.1) [12ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.118.0
[✓] Connected device (2 available) [7.1s]
• macOS (desktop) • macos • darwin-arm64 • macOS 26.1 25B5042k darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 140.0.7339.185
! Error: Browsing on the local area network for iPad von The. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [329ms]
• All expected network resources are available.
! Doctor found issues in 1 category.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: widget previewsIssues related to the Widget Previewer toolingIssues related to the Widget Previewer toolingfound in release: 3.35Found to occur in 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37Found to occur in 3.37has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Activity
[-][widget preview] workspaces with nested projects (like examples) don't work[/-][+][widget previews] workspaces with nested projects (like examples) don't work[/+]darshankawar commentedon Sep 26, 2025
I do see the same behavior but only if we try to run the command
flutter widget-preview startfrom project root.If we
cd packages/asdfthen the above error doesn't occur but then we hit #176017Keeping the issue open for team's tracking.
bkonyi commentedon Sep 30, 2025
It looks like you have an issue in your
pubspec.yamlforpackages/asdf/example/. I believe this line should be the following:Making that change fixes the error you were seeing.
benthillerkus commentedon Sep 30, 2025
@bkonyi no, this is correct. See https://dart.dev/tools/pub/workspaces#interdependencies-between-workspace-packages
It means that any version of the asdf package is ok, and since
resolutionis set to workspace, it will resolve to the local version first.[ Widget Preview ] Fix resolution for workspace "hosted" dependencies
bkonyi commentedon Oct 1, 2025
Thanks for pointing that out @benthillerkus! I've never seen that syntax before so just assumed it was invalid.
I should have a fix for this here: #176358.
[ Widget Preview ] Fix resolution for workspace "hosted" dependencies (…
[ Widget Preview ] Fix resolution for workspace "hosted" dependencies (…
[ Widget Preview ] Fix resolution for workspace "hosted" dependencies (…
github-actions commentedon Oct 17, 2025
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.[ Widget Preview ] Fix resolution for workspace "hosted" dependencies (…
[ Widget Preview ] Fix resolution for workspace "hosted" dependencies…