After upgrading my Firebase project, I got this warning message when deploying my project to Firebase hosting.
Deprecation Warning: Firebase Hosting configuration should be moved under "hosting" key.
Anyone has the same problem? How can I fix this?
Go to Firebase Console and select Hosting from the menu of the left. You will see the deployed project with a list of your historical actions like Deployed , disabled , etc. Only after you have disabled the site, the "three vertical dots" menu will be available for you to choose the action to delete the deployment.
Many common tasks, such as deploying a Firebase project, require a project directory. We set up the project directory using the Firebase init command. The project directory is usually the same directory as our source control root. After running Firebase Init, the directory contains the Firebase.
You just need to modify your firebase.json file which I assume looks somewhat like this:
{
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
You need to move the different keys specified (in this case, public
, ignore
and rewrites
key) to the hosting
key so the snippet above would look like below.
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
Check out this link for more info on Firebase hosting deployment configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With