Repository navigation
ng deploy infinite setup loop #3546
Copy link
Copy link
Open
Labels
comp: schematicsng add / deploy schematics (src/schematics).ng add / deploy schematics (src/schematics).triaged: keep-openTriaged and intentionally kept open; exempt from any future stale process.Triaged and intentionally kept open; exempt from any future stale process.type: bugDefect: expected behavior doesn't happen.Defect: expected behavior doesn't happen.version: current (v17+)Targets the current modular API (v17+).Targets the current modular API (v17+).
Description
Version info
Angular: 18.0.3
Firebase: ??
AngularFire: 18.0.1
Other (e.g. Ionic/Cordova, Node, browser, operating system):
How to reproduce these conditions
Failing test unit, Stackblitz demonstrating the problem
This involves running the schematics, so stackblitz doesn't help.
Steps to set up and reproduce
Follow the steps in these docs. I.e.:
ng new the-project, choose default optionscd the-projectng add @angular/firechoose Performance Monitoring (I don't want any of them actually. I only want to deploy. But I had even worse luck if I chose nothing - so this is a semi-random choice.)- At this point the doc says it should have created a
.firebasercfile updatedangular.json, but neither of these are true
- At this point the doc says it should have created a
ng deploy- Here it asks me what to use to deploy. I choose "Firebase" and it simply loops me through the setup steps again, never deploying.
Sample data and security rules
Debug output
** Errors in the JavaScript console **
None
** Output from firebase.database().enableLogging(true); **
I'm not running the app, so I don't think this applies.
** Screenshots **
None
Expected behavior
I can use schematics to set up firebase hosting.
Actual behavior
Schematics do not set up firebase hosting. Instead every time I try to deploy it loops me back through the setup process.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
comp: schematicsng add / deploy schematics (src/schematics).ng add / deploy schematics (src/schematics).triaged: keep-openTriaged and intentionally kept open; exempt from any future stale process.Triaged and intentionally kept open; exempt from any future stale process.type: bugDefect: expected behavior doesn't happen.Defect: expected behavior doesn't happen.version: current (v17+)Targets the current modular API (v17+).Targets the current modular API (v17+).
Activity
davidlj95 commentedon Jul 30, 2024
Can reproduce it here too. After running
ng deploy, this is the output after selecting a project + app to deploy:If running
ng deployagain, same happensSome notes about the setup:
I think there are two issues here also:
ng deployand choosing Firebase (this setup loop)More details:
Angular `ng version` output
andreasvg commentedon Aug 21, 2024
This is still an issue (more than two months after the original post).
I've tried using Angular v18 and v17, also tried on Mac and Windows and angularfire is not setting up the deploy configuration in
angular.jsonat all. I have tried using Node versions18.13.0,18.16.0and18.19.1.As a workaround I was able to copy configuration from a previous project and amend it for my new project, specifically:
angular.jsonfirebase.json.firebase.rcfiletechnokon commentedon Sep 12, 2024
still happening with lates setup of angular and angular/fire
grantoverby commentedon Jan 9, 2025
@andreasvg Could you post example code snippets of those three files please?
I've found several varying examples via google, but none work.
mackermand commentedon Jan 11, 2025
Same issue for me. I was able to setup the deploy using firebase-tools instead.
Harris6144 commentedon Oct 1, 2025
This bug has existed for years now. Any plans to fix it?
armando-navarro commentedon Jul 26, 2026
Thanks for the detailed reports, and for confirming it across macOS, Windows, npm and pnpm.
I reproduced the mechanism.
ng add @angular/fire's setup does not write adeploytarget into yourangular.json: it adds the providers and the firebase config files, but never the deploy builder target for the project. And when you runng deploywith no such target, the CLI printsCannot find "deploy" target for the specified projectand points you back tong add @angular/fire. So you end up in a circle:ng deploysends you tong add,ng adddoes not wire up deploy, andng deploystill cannot find a target.As a workaround until this is fixed, you can add the target by hand to
angular.json:alongside a
firebase.jsonand.firebaserccopied from a working project.I want to fix this in the schematic so setup writes the deploy target. One thing I am still isolating: a couple of reports also show the setup step itself exiting with an
ELIFECYCLEerror right after it updatesapp.config.ts, which I have not reproduced yet and which may be a separate problem. If your logs show it failing at a different point than "cannot find deploy target", please share them and I will factor that in.