I have a flutter web app that I used firebase for its database, authentication and deployment, but whenever I deploy I only see this screen. this is the firebase.json file
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
Has anyone faced this problem before? I tried to change the Firebase project and it didn't make a difference
I have a flutter web app that I used firebase for its database, authentication and deployment, but whenever I deploy I only see this screen. this is the firebase.json file
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
Has anyone faced this problem before? I tried to change the Firebase project and it didn't make a difference
It looks like this is an issue with how your hosting.public
is configured. In Flutter, your built web application is located in build/web
folder. Since the hosting.public
attribute specifies which directory to deploy to Firebase Hosting(reference), you have to set it's value to where your Flutter web application build is located.
Update your firebase.json
to something like:
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}