Skip to content

[widget previews] workspaces with nested projects (like examples) don't work #176018

Closed

Description

@benthillerkus

Steps to reproduce

  1. git clone https://github.com/benthillerkus/widget-preview-repro-workspaces.git
  2. check out the nested branch
  3. flutter pub get
  4. flutter 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.

Activity

  1. changed the title [-][widget preview] workspaces with nested projects (like examples) don't work[/-] [+][widget previews] workspaces with nested projects (like examples) don't work[/+] on Sep 25, 2025
  2. darshankawar commented on Sep 26, 2025

    @darshankawar
    Member

    I do see the same behavior but only if we try to run the command flutter widget-preview start from project root.
    If we cd packages/asdf then the above error doesn't occur but then we hit #176017

    Keeping the issue open for team's tracking.

    stable: 3.35.4
    master: 3.37.0-1.0.pre-299
    
  3. added
    a: widget previewsIssues related to the Widget Previewer tooling
    toolAffects the "flutter" command-line tool. See also t: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-toolOwned by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Sep 26, 2025
  4. bkonyi commented on Sep 30, 2025

    @bkonyi
    Contributor

    It looks like you have an issue in your pubspec.yaml for packages/asdf/example/. I believe this line should be the following:

    asdf:
      path: ..

    Making that change fixes the error you were seeing.

  5. benthillerkus commented on Sep 30, 2025

    @benthillerkus
    ContributorAuthor

    @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 resolution is set to workspace, it will resolve to the local version first.

  6. reopened this on Sep 30, 2025
  7. added
    P1High-priority issues at the top of the work list
    triaged-toolTriaged by Flutter Tool team
    on Oct 1, 2025
  8. self-assigned this
    on Oct 1, 2025
  9. bkonyi commented on Oct 1, 2025

    @bkonyi
    Contributor

    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.

  10. added
    r: fixedIssue is closed as already fixed in a newer version
    on Oct 3, 2025
  11. github-actions commented on Oct 17, 2025

    @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.

  12. locked as resolved and limited conversation to collaborators on Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: widget previewsIssues related to the Widget Previewer toolingfound in release: 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions