1

I'm trying to deploy an angular app to Firebase. Firebase is setup to host multiple sites.

In Firebase, the project name is 'myapp-staging-84e3e'. There are two sites setup in Firebase which are 'myapp-admin-staging' and 'myapp-staging-84e3e'. I'm trying to deploy this app to 'myapp-admin-staging'.

When I try to run firebase deploy --only hosting:admin I get the following error in firebase-debug.log;

[debug] [2020-08-24T15:19:23.581Z] TypeError: Cannot read property 'deploys' of undefined
    at /usr/local/lib/node_modules/firebase-tools/lib/deploy/index.js:84:36
    at processTicksAndRejections (internal/process/task_queues.js:82:5)
[error] 
[error] Error: An unexpected error has occurred.

I must have something setup incorrectly but I can't determine what it is. My .firebaserc file looks like this;

    {
  "targets": {
    "myapp-staging-84e3e": {
      "hosting": {
        "admin": [
          "myapp-admin-staging"
        ]
      }
    }
  },
  "projects": {
    "default": "myapp-staging-84e3e"
  }
}

Then the firebase.json file looks like this;

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

Where am I going wrong?

1 Answer 1

1

You need to add "target": "admin" to your firebase.json so that it looks like this:

{
  "hosting": {
    "target": "admin", //added
    "public": "dist/MyApp-Admin",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.