Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Assertion failed: resolving hosting target of a site with no site name or target name -> Deploying change in Firebase Hosting to Live site

{
  "database": {
    "rules": "database.rules.json"
  },
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "hosting": [
    {
      "public": "dist/nur",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    },
    {
      "target": "nur",
      "public": "dist/nur",
      "ignore": [
        "**/.*"
      ],
      "headers": [
        {
          "source": "*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)",
          "headers": [
            {
              "key": "Cache-Control",
              "value": "public,max-age=31536000,immutable"
            }
          ]
        },
        {
          "source": "/@(ngsw-worker.js|ngsw.json)",
          "headers": [
            {
              "key": "Cache-Control",
              "value": "no-cache"
            }
          ]
        }
      ],
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    }
  ],
  "storage": {
    "rules": "storage.rules"
  }
}


Tried firebase deploy command through Firebase to deploy the changes.

Deploying to 'nur-beta'...

i  deploying database, storage, firestore, hosting
i  database: checking rules syntax...
database: rules syntax for database nur-beta-default-rtdb is valid
i  firebase.storage: checking storage.rules for compilation errors...
firebase.storage: rules file storage.rules compiled successfully
i  firestore: reading indexes from firestore.indexes.json...
i  cloud.firestore: checking firestore.rules for compilation errors...
cloud.firestore: rules file firestore.rules compiled successfully

After all resources deployement it gives assertion failed message.

Error: Assertion failed: resolving hosting target of a site with no site name or target name. This should have caused an error earlier. May I know what I'm missing while deploying the changes to already LIVE web-site hosted under Firebase Hosting.

like image 517
Azad Usmani Avatar asked Nov 24 '25 18:11

Azad Usmani


2 Answers

You just have to log in to the console again.

firebase login --reauth
like image 190
Ángel De La Cruz Avatar answered Nov 26 '25 06:11

Ángel De La Cruz


Log out and login in again, at least that's what worked for me

like image 42
Africanfruit Avatar answered Nov 26 '25 08:11

Africanfruit