Search code examples
angularfirebasefirebase-hosting

Multisite Firebase deploy Hosting Error 500


I try to deploy a little webpage with firebase hosting for some tests.

I don't want it to be hosted on the "main" url of the firebase project. Since it's already taken by the main website.

So I created another site like this :

sorry, its in french, but you get the idea, and how can I add a picture without you having to click on the link ?

Then I just added firebase to the project and wrote this firebase.json :

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

Then to deploy I type on the console :

firebase target:apply hosting thumbnail thumbnail-spotify.web.app
firebase deploy --only hosting

But I get :

=== Deploying to 'pocspotifyautomate'...

i  deploying hosting

Error: HTTP Error: 500, Internal error encountered.

Other stackoverflow and forum talks about bugs on Firebase platform side, but that was years ago, and maybe not the case here, since I can deploy the main website without any issue. s Do someone have an idea ?


Solution

  • Well in firebase.json file if in line target you have this "target": "thumbnail". In .firebaserc file you should have some thing like this:

    {
      "targets": {
        "your-project-name": {
          "hosting": {
            "thumbnail": [ // here is your target you have to have seted up in firebase.json
              "thumbnail-spotify" // here is hosting URL prefix you have in firebase console
            ]
          }
        }
      },
      "projects": {
        "default": "your-project-name"
      }
    }