How to build flutter web app in debug mode?

Try:

flutter build web --profile --dart-define=Dart2jsOptimization=O0

See:

https://github.com/flutter/flutter/blob/720dff6a94bd054e82ec4bf84b5cb802bbc52ddd/packages/flutter_tools/lib/src/build_system/targets/web.dart#L238-L239


The only way I have found to do this is to use flutter run -d chrome. We would then need to locate where the files on disk are located.


There's an issue on github for this feature, feel free to upvote ;)

https://github.com/flutter/flutter/issues/96283

Tags:

Flutter Web