Reputation: 139
I am receiving the error 'Must supply a public directory using "public" in each "hosting" config.' when deploying my firebase app. How do I fix this?
Upvotes: 8
Views: 4233
Reputation: 164
So this basically means you need to specify your public folder which is the folder that contains the index file "destination" of your 'static files' folder '(build)' or as you may call it the root folder of your project.
if '/' is used instead of '/public' then this means if you /cd into public from your terminal - 'the folder that contains the index file' - the destination as specified in the firebase.JSON file, then the inside of the of the 'public' folder will be where your firebase file is initialised.
Upvotes: 0
Reputation: 1278
I was using "public: ""
to deploy the root directory. When it forced me to use a value I instead passed
"public": "."
which worked.
Upvotes: 10
Reputation: 78
Got the same error and fixed it with adding "public" to firebase.json
in the empty "public" attribute.
Your firebase.json
should be like this.
"hosting": {
"public": "public", // <- Added
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
Upvotes: 4