Firebase Hosting Deployment Error HTTP 400 Error

Kamil Kamili

I was trying to redeploy my react app on firebase after fixing some issues. But redeploying is giving errors. Not sure what the problem is.

I also tried to look into the answers provided in other posts but nothing worked for me.

firebase.json details below:

{
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [{
      "source": "**",
      "destination": "/index.html",
      "headers": [{
        "key": "Cache-Control",
        "value": "max-age=0"
      }]
    }]
  }
}

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

This is the first time I have come across this error. So no idea what the problem is.

HakanC

Headers options look line inside of rewrites parameters. instead, you need to move out as:

"hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [{
      "source": "**",
      "destination": "/index.html"
    }],
    "headers": [{
        "key": "Cache-Control",
        "value": "max-age=0"
    }]
  }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related