Open
@h11a

Description

Versions:
"@angular/cli": "^14.2.10",
"@angular/cdk": "^14.2.1",
"@angular/fire": "^7.4.1",
"firebase": "^9.6.8",

I am having issues with setting up config to allow deploying to a dev/prod sites on Firebase hosting. The sites on firebase are in the same firebase project

I have followed this guide
https://.com/angular/angularfire/blob/master/docs/deploy/getting-started.md

but I am receiving the same issue as these old unanswered issues
#3077

#3076

Here is my setup

  1. angular.json
   "deploy": {
                    "builder": "@angular/fire:deploy",
                    "options": {
                        "firebaseProject": "<<MY_FIREBASE_PROJECT_ID>>",
                        "siteTarget": "devTarget",
                        "buildTarget": "<<MY_ANGULAR_PROJECT>>:build:development"
                    },
                    "configurations": {
                        "dev": {
                            "firebaseProject": "<<MY_FIREBASE_PROJECT_ID>>",
                            "siteTarget": "devTarget",
                            "buildTarget": "<<MY_ANGULAR_PROJECT>>:build:development"
                        },
                        "prod": {
                            "firebaseProject": "<<MY_FIREBASE_PROJECT_ID>>",
                            "siteTarget": "prodTarget",
                            "buildTarget": "<<MY_ANGULAR_PROJECT>>:build:development"
                        }
                    }
                }
            }
  1. firebase.json
{
    "hosting": [
        {
            "target": "devTarget",
            "public": "dist",
            "ignore": [
                "**/.*"
            ]
        },
        {
            "target": "prodTarget",
            "public": "dist",
            "ignore": [
                "**/.*"
            ]
        }
    ]
}
  1. .firebaserc
{
  "projects": {
    "default": "<<MY_FIREBASE_PROJECT_ID>>"
  },
  "targets": {
    "<<MY_FIREBASE_PROJECT_ID>>": {
      "hosting": {
        "devTarget": [
          "<<DEV_SITE_ID>>"
        ],
        "prodTarget": [
          "<<PROD_SITE_ID>>"
        ]
      }
    },
  "etags": {}
}

Should this work if i run ng deploy <<MY_ANGULAR_PROJECT>> --configuration='dev'?

I receive the following error from node_modules\@angular\fire\schematics\deploy\builder.js:36:15

An unhandled exception occurred: The Firebase Hosting Site specified by your angular.json or .firebaserc is in conflict