Flutter Web App Using StreamProvider Shows Gray Screen When Deployed to Firebase

Viewed 165

I am using firebase hosting to run a flutter web app. Everything was working well until I added firebase auth and a StreamProvider. It works perfectly when run locally from vs code in debug or release mode. However, when deployed to firebase hosting only a gray screen is displayed, and the website is unusable. I know that this indicates that there is an error, but I'm not sure what the error is, or where I can find my firebase hosting error logs. Any help would be appreciated.

Additionally, when I test the firebase project locally using the command "firebase serve --only hosting" I get the gray screen, but the log in the console does not provide helpful info.

Also when I remove the StreamProvider widget the error goes away, but the functionality is lost. Here is a simplified version of the code I'm using:

Widget build(BuildContext context) {    
    StreamProvider<User>.value(
        value: FirebaseAuth.instance.authStateChanges()
        child: MaterialApp(
            ...
        ),
    ),
}
0 Answers
Related