maganap
maganap

Reputation: 2904

Firebase App Hosting Angular 18 build fails "Unable to determine the application to deploy"

We have an Angular 18 app with 2 projects (applications) configured:

angular.json:

{
  "projects": {
    "admin" {
      "projectType": "application"
    },
    "web" {
      "projectType": "application"
    }
  }
}

We configured App Hosting according to the documentation for a basic example.

On push to GitHub, build is triggered to Cloud Build but fails with:

Step #2: Error: Unable to determine the application to deploy

Source of the error shown here, which doesn't seem to leave much room for an input to decide on what app to build.

We found this exact same issue, but their solution didn't work for us. We do have angular-devkit/core and it still fails to build.

We also noticed that if we change one of the projects to be a library (in angular.json: "projectType": "library"), then the Cloud Build does work.

How do we configure App Hosting so it knows which app to build?

Upvotes: 3

Views: 250

Answers (1)

Lukas Bühler
Lukas Bühler

Reputation: 168

The problem is that it is currently not working at all if you have multiple Angular projects in the same repo. It goes even further, even projects with one Angular project but multiple nested package.json don't work at the moment (see here: https://firebase.google.com/docs/app-hosting/about-app-hosting#known-issues)

You will have to split it into two repos if you are looking to build with Firebase App Hosting at the moment.

You can take a look at the adapter source code on Github.

It has the following line of code:

if (apps.length > 1 || !project) throw new Error("Unable to determine the application to deploy");

This means that if there are more than two angular projects, or it couldn't find a project at all, it just throws this error and aborts.

Upvotes: 2

Related Questions