angularfirebasegoogle-cloud-platformangular-ssrfirebase-app-hosting

Firebase App Hosting rollout fails for Angular 18 web app with "Unable to determine the application to deploy"


The Firebase app hosting rollout fails for an Angular 18 web app with SSR.

The rollout fails after the step:

Step #2: Running "npm exec --prefix /layers/google.nodejs.firebaseangular/npm_modules apphosting-adapter-angular-build"

with the error message:

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

I have followed the 'Get started with App Hosting' (here) and other documentation, and at no point is anything mentioned about what is expected for the structure of the project. I looked at the Angular basic starter app for Firebase App hosting (here) and I followed its angular.json to have my project compile with the same structure. No success.

One other thing I have tried was using a apphosting.yaml file but it did not help so I removed it again. See: https://firebase.google.com/docs/app-hosting/configure

I have previously also tried with Angular 17, where the rollout also failed, therefore I thought upgrading to Angular 18 might help, but it did not.

The logs also tell me to look into Google Cloud Buildpacks:

Step #2: Our documentation explains ways to configure Buildpacks to better recognise your project:
Step #2:  -> https://cloud.google.com/docs/buildpacks/overview

which is what I will do next in hopes of finding the cause of my problem.

However, any help is greatly appreciated!


Solution

  • I found the problem for this specific error. I was missing the @angular-devkit/core package in my package.json. Which I then installed with npm i -D @angular-devkit/core.

    What got me there was looking at the source code that generated this error message on Github.

    This was also where I saw that this specific error is thrown if either no project, or more than one project is found in the repo.

    In my case it was thrown because the @angular-devkit/core package was missing.