Search code examples
firebasefirebase-hosting

"Public Directory Warning - Public directory is empty" on firebase deploy


I have a firebase app with the following hosting configuration:

{
  "firebase": "the-world-table",
  "public": "app",
  "ignore": [
    "firebase.json",
    "**.*",
    "**/node_modules/**"
  ]
}

The app directory is not empty (it has an index.html and a javascript file in it). However, when I deploy I get the following warning:

Preparing to deploy Public Directory...
Public Directory Warning - Public directory is empty, removing site
progress: 100%
Sucessfully removed

And when I browse to the static files, they aren't found. Any ideas what is wrong here?


Solution

  • Your ignore rules appear to be a little over zealous in removing files from the directory you specified to be deployed:

    Instead of the default **/.* ignore rule which matches all files in any sub-folder that contain a . character, the rule you specify **.* matches all files in the root of the folder to be deployed that contains a ., which in this case caused nothing to remain. If you remove this line or add the / back in you should see the behavior you expect.

    The docs on the subject cover the basics of glob pattern matching and offer some further references