fix: Flutter web does not launch if no assets are found in pubspec.yaml
Description
If you fail to or incorrectly provide assets configuration in pubspec.yaml file the app never finishes launching.
Steps To Reproduce
Just like with #11
- Create a flutter app with web platform inclusive
- Run mason make flutter_web_preloader and just hit enter so it overrides the index.html
- Build and run the app targeting web
- See that you get stuck on
Launching lib/main_development.dart on Chrome in debug mode...for example and that the progress indicator never fills up. - Adding assets fixes the issue if configured properly, you can just comment it out to replicate the issue or add assets without a tab in-front in the pubspec.
Expected Behavior Launch the app regardless of the asset configuration
Screenshots How it is with/without assets in the pubspec
Thanks @Nana-Kwame-bot for opening this issue! I was able to reproduce it using flutter_web_preloader 0.2.0.
Flutter doctor
[✓] Flutter (Channel stable, 3.16.3, on macOS 14.0 23A344 darwin-arm64, locale
en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.4)
[✓] IntelliJ IDEA Community Edition (version 2023.1.4)
[✓] VS Code (version 1.84.0)
[✓] Connected device (2 available)
[✓] Network resources
@erickzanardo looking for some input on this one from your side. Overall I think that this is actually not the intended purpose of this package but we could put some kind of workaround in as a just in case type of fix.
Hey @tomarra :wave:
Think about it right now, I think it can make sense to run this in a project, even if there are no assets listed in the pubspec, since this brick also preloads some internal flutter assets.
Think about it right now, I think it can make sense to run this in a project, even if there are no assets listed in the pubspec, since this brick also preloads some internal flutter assets.
Good to know. In that case, is the fix here something you can help document and maybe then someone else can help with the implementation?