Open Rexios80 opened 4 months ago
I found where this error is supposed to be thrown: https://github.com/flutter/flutter/blob/b9b0784ea4089ee394c0ba92658bd4d25e466b9d/packages/flutter_tools/lib/src/commands/run.dart#L671
But it appears validateCommand
isn't getting called for flutter drive
somehow
Thanks for the proposal. For context, when running the test with flutter drive --web-renderer skwasm
, there is an error on browser's console that makes the Flutter program hang (the detail use case is on https://github.com/flutter/flutter/issues/150947):
Uncaught (in promise) FlutterLoader could not find a build compatible with configuration and environment.
I found where this error is supposed to be thrown:
But it appears
validateCommand
isn't getting called forflutter drive
somehow
The code pointed out here is for the run
command. Perhaps it should be moved from RunCommand
to the parent RunCommandBase
, which DriveCommand
also extends.
You are totally right! For some reason I thought that code was in the base class.
Use case
This command pretends to work, but the launched web build is broken:
flutter drive --web-renderer skwasm
The proper command is as follows:
flutter drive --wasm
This has caused me confusion in the past due to the command structure of running dart tests compiled to wasm:
dart run -p chrome -c dart2wasm
See https://github.com/flutter/flutter/issues/150947
Proposal
Throw a graceful error like
flutter run --web-renderer skwasm
instead of launching a broken web build