When deploying with Firebase hosting, I get hostin

2019-06-15 13:47发布

问题:

Deploying an application to Firebase hosting, I get the following error:

HTTP Error: 400, hosting.rewrites[0] is not exactly one from [subschema 0],[subschema 1]

This occurs with a simple configuration like:

{
  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "/*/*",
        "destination": "index.html"
      }
    ]
  }
}

This configuration does work when serving locally.

回答1:

Apparently, the error indicates that I should put a '/' in front of 'index.html'. Then it works for local and remote deploy.