Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase: Deprecation Warning: Firebase Hosting configuration should be moved under "hosting" key

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?

like image 893
Thịnh Phạm Avatar asked May 19 '16 07:05

Thịnh Phạm


People also ask

How do I remove Firebase Hosting setup complete?

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.

Which command is used for deploying a Firebase hosted application?

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.


1 Answers

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.

like image 87
Prits Pri Teish Avatar answered Nov 13 '22 09:11

Prits Pri Teish