Skip to content

Conversation

@bkonyi
Copy link
Contributor

@bkonyi bkonyi commented Nov 13, 2025

If Flutter Web is not enabled, the widget previewer will crash when trying to find a web device to launch with. This change explicitly checks for this case and throws ToolExit with instructions to enable Flutter Web if it's not enabled.

Fixes #178486

If Flutter Web is not enabled, the widget previewer will crash when
trying to find a web device to launch with. This change explicitly
checks for this case and throws `ToolExit` with instructions to enable
Flutter Web if it's not enabled.

Fixes #178486
@bkonyi bkonyi requested a review from jyameo November 13, 2025 22:05
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Nov 13, 2025
@bkonyi bkonyi added autosubmit Merge PR when tree becomes green via auto submit App and removed tool Affects the "flutter" command-line tool. See also t: labels. labels Nov 13, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a check to the widget preview command to ensure that Flutter Web is enabled. If it is not, the command now exits with a helpful error message instructing the user on how to enable it. This prevents a crash that would otherwise occur when no web devices can be found. The change also includes a new test case to verify this behavior. The implementation is correct and improves the user experience for the widget preview feature.

Copy link
Contributor

@jyameo jyameo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@auto-submit auto-submit bot added this pull request to the merge queue Nov 14, 2025
Merged via the queue into master with commit 1f69497 Nov 14, 2025
151 checks passed
@auto-submit auto-submit bot deleted the widget_preview_flutter_web_check branch November 14, 2025 16:27
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
@bkonyi bkonyi added cp: beta cherry pick this pull request to beta release candidate branch cp: stable cherry pick this pull request to stable release candidate branch labels Nov 14, 2025
flutteractionsbot pushed a commit to flutteractionsbot/flutter that referenced this pull request Nov 14, 2025
…utter#178500)

If Flutter Web is not enabled, the widget previewer will crash when
trying to find a web device to launch with. This change explicitly
checks for this case and throws `ToolExit` with instructions to enable
Flutter Web if it's not enabled.

Fixes flutter#178486
flutteractionsbot pushed a commit to flutteractionsbot/flutter that referenced this pull request Nov 14, 2025
…utter#178500)

If Flutter Web is not enabled, the widget previewer will crash when
trying to find a web device to launch with. This change explicitly
checks for this case and throws `ToolExit` with instructions to enable
Flutter Web if it's not enabled.

Fixes flutter#178486
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
IvoneDjaja pushed a commit to IvoneDjaja/flutter that referenced this pull request Nov 22, 2025
…utter#178500)

If Flutter Web is not enabled, the widget previewer will crash when
trying to find a web device to launch with. This change explicitly
checks for this case and throws `ToolExit` with instructions to enable
Flutter Web if it's not enabled.

Fixes flutter#178486
mboetger pushed a commit to mboetger/flutter that referenced this pull request Dec 2, 2025
…utter#178500)

If Flutter Web is not enabled, the widget previewer will crash when
trying to find a web device to launch with. This change explicitly
checks for this case and throws `ToolExit` with instructions to enable
Flutter Web if it's not enabled.

Fixes flutter#178486
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…utter#178500)

If Flutter Web is not enabled, the widget previewer will crash when
trying to find a web device to launch with. This change explicitly
checks for this case and throws `ToolExit` with instructions to enable
Flutter Web if it's not enabled.

Fixes flutter#178486
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cp: beta cherry pick this pull request to beta release candidate branch cp: stable cherry pick this pull request to stable release candidate branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants