Skip to content

[ Widget Preview ] Crash when .dart_tool/widget_preview_scaffold/.dart_tool doesn't exist on subsequent runs #178660

Closed

Description

@bkonyi

This can happen if flutter widget-preview start is interrupted or flutter pub get isn't run in the widget_preview_scaffold project when it's first initialized.

Example Logs

StateError: Bad state: Could not determine run package name. Project path "/private/var/folders/_y/rdj_3wtj5mbbtf6syy_2cw6800d8lv/T/flutter_widget_preview_test.HHIWrz/.dart_tool/widget_preview_scaffold/" did not occur as package root in package config "/private/var/folders/_y/rdj_3wtj5mbbtf6syy_2cw6800d8lv/T/flutter_widget_preview_test.HHIWrz/.dart_tool/package_config.json". Please report a reproduction on https://github.com/flutter/flutter/issues/169475.
```console
#0      DartBuild.build (package:flutter_tools/src/build_system/targets/native_assets.dart:50:7)
<asynchronous suspension>
#1      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:915:9)
<asynchronous suspension>
#2      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:662:16)
<asynchronous suspension>
#3      FlutterHookRunnerNative.runHooks (package:flutter_tools/src/build_system/targets/hook_runner_native.dart:30:35)
<asynchronous suspension>
#4      ResidentWebRunner._updateDevFS (package:flutter_tools/src/isolated/resident_web_runner.dart:760:28)
<asynchronous suspension>
#5      ResidentWebRunner.run.<anonymous closure> (package:flutter_tools/src/isolated/resident_web_runner.dart:324:41)
<asynchronous suspension>
#6      asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:108:24)
<asynchronous suspension>

Activity

  1. self-assigned this
    on Nov 17, 2025
  2. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    P2Important issues not at the top of the work list
    triaged-toolTriaged by Flutter Tool team
    a: widget previewsIssues related to the Widget Previewer tooling
    on Nov 17, 2025
  3. github-actions commented on Dec 1, 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.

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

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: widget previewsIssues related to the Widget Previewer toolingtoolAffects 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