Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Flutter web does not launch if no assets are found in pubspec.yaml #22

Open
Nana-Kwame-bot opened this issue Dec 17, 2023 · 4 comments
Labels
bug Something isn't working as expected p3 Issues that we currently consider unimportant

Comments

@Nana-Kwame-bot
Copy link

Nana-Kwame-bot commented Dec 17, 2023

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

  1. Create a flutter app with web platform inclusive
  2. Run mason make flutter_web_preloader and just hit enter so it overrides the index.html
  3. Build and run the app targeting web
  4. 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.
  5. 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

@Nana-Kwame-bot Nana-Kwame-bot added the bug Something isn't working as expected label Dec 17, 2023
@Nana-Kwame-bot Nana-Kwame-bot changed the title fix: Flutter web does not launch if no assets are found in pubspect.yaml fix: Flutter web does not launch if no assets are found in pubspec.yaml Dec 17, 2023
@alestiago
Copy link
Contributor

alestiago commented Dec 18, 2023

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

@tomarra
Copy link
Contributor

tomarra commented Jan 8, 2024

@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.

@erickzanardo
Copy link
Contributor

Hey @tomarra 👋

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.

@tomarra
Copy link
Contributor

tomarra commented Jan 8, 2024

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?

@tomarra tomarra added p3 Issues that we currently consider unimportant and removed has reproductible steps labels Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected p3 Issues that we currently consider unimportant
Projects
Status: Backlog
Development

No branches or pull requests

4 participants