Skip to content

[ Widget Preview ] Crashes when flutter config --no-enable-web is set #178486

Closed

Description

@bkonyi

If a user has set flutter config --no-enable-web, the widget previewer will crash on launch with one of the two following errors:

flutter widget-preview start:

Error: Failed to locate browser. Make sure you are using an up-to-date Chrome or Edge. Otherwise, consider running with --web-server instead.

flutter widget-preview start --web-server:

StateError: Bad state: No element

#0      List.single (dart:core-patch/growable_array.dart:362:22)
#1      WidgetPreviewStartCommand.runPreviewEnvironment (package:flutter_tools/src/commands/widget_preview.dart:404:26)
<asynchronous suspension>
#2      WidgetPreviewStartCommand.runCommand (package:flutter_tools/src/commands/widget_preview.dart:344:24)
<asynchronous suspension>
#3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1559:27)
<asynchronous suspension>
#4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#6      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:487:9)
<asynchronous suspension>
#7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#8      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:422:5)
<asynchronous suspension>
#9      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:101:11)
<asynchronous suspension>
#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#11     main (package:flutter_tools/executable.dart:103:3)
<asynchronous suspension>

Activity

  1. self-assigned this
    on Nov 13, 2025
  2. added
    P2Important issues not at the top of the work list
    team-toolOwned by Flutter Tool team
    triaged-toolTriaged by Flutter Tool team
    a: widget previewsIssues related to the Widget Previewer tooling
    on Nov 13, 2025
  3. github-actions commented on Nov 28, 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 Nov 28, 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 toolingteam-toolOwned by Flutter Tool teamtriaged-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