firebase-tools:
v7.0.0
Platform:
macOS 10.14.4
Flutter Web prod build doesn't work on firebase hosting
webdev buildBrowser should show Hello world page
Browser show blank page
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.
I went through these processes and was able to successfully deploy the hello_world example to my project (after installing flutter, dart, etc).
Can you provide your firebase.json file (to check any settings there) and maybe run the deploy again with the --debug flag and provide that output?
Hi @bkendall,
I have prepared test project for you.
https://github.com/AlexVegner/firebaseTest
Prerequisites
Make sure that you work with flutter beta chanel:
bash setup.bash
https://github.com/AlexVegner/firebaseTest/blob/master/setup.bash
Init firebase with your project
cd firebase && firebase init
Deploy script
bash deploy.bash
My results:
Firebase doesn't work:
https://test-alex-cb960.firebaseapp.com/#/
Github pages works fine:
https://alexvegner.github.io/firebaseTestWeb/#/
See firebase tool log:
https://github.com/AlexVegner/firebaseTest/blob/master/firebase/firebase-debug.log
Flutter isn't the issue here. In firebase.json it's set up to redirect everything to /index.html. When I just run firebase emulators:start --only hosting, I get an empty page because (as is clear in the browser developer tools), the .json asset that it tries to load is actually html:

Which causes a javascript error:

Once I removed the rewrites block from firebase.json, everything worked as expected.

Since this isn't a firebase-tools bug, I'm going to close this issue. But let us know if you have any questions! Hope this gets you unblocked!
Hi @bkendall,
It works for me.
Hi @bkendall,
can you plz explain me what actually happens when we rewrite all the URLs to index.html
@AlexVegner can u help me ?? i follow your instructions (using .bash files) with a new flutter web app and i obtain a blank page https://linajevanguardistas-2018.firebaseapp.com/#/
https://medium.com/@abhijeetdash1999/flutter-web-with-firebase-hosting-82c341989b37
@AbhijeetDash Thanks a lot, its work !!
Most helpful comment
Flutter isn't the issue here. In
firebase.jsonit's set up to redirect everything to/index.html. When I just runfirebase emulators:start --only hosting, I get an empty page because (as is clear in the browser developer tools), the.jsonasset that it tries to load is actually html:Which causes a javascript error:
Once I removed the
rewritesblock fromfirebase.json, everything worked as expected.Since this isn't a
firebase-toolsbug, I'm going to close this issue. But let us know if you have any questions! Hope this gets you unblocked!