Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng deploy infinite setup loop #3546

Open
ersimont opened this issue Jun 9, 2024 · 3 comments
Open

ng deploy infinite setup loop #3546

ersimont opened this issue Jun 9, 2024 · 3 comments

Comments

@ersimont
Copy link

ersimont commented Jun 9, 2024

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.:

  1. ng new the-project, choose default options
  2. cd the-project
  3. ng add @angular/fire choose 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 .firebaserc file updated angular.json, but neither of these are true
  4. 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.

@davidlj95
Copy link

davidlj95 commented Jul 30, 2024

Can reproduce it here too. After running ng deploy, this is the output after selecting a project + app to deploy:

Cannot find "deploy" target for the specified project.
You can add a package that implements these capabilities.

For example:
  Amazon S3: ng add @jefiozie/ngx-aws-deploy
  Firebase: ng add @angular/fire
  Netlify: ng add @netlify-builder/deploy
  GitHub Pages: ng add angular-cli-ghpages

 Would you like to add a package with "deploy" capabilities now? Firebase
Skipping installation: Package already installed
UPDATE package.json (1345 bytes)
✔ Packages installed successfully.
? What features would you like to setup? Google Analytics
Using firebase-tools version 13.14.2
? Which Firebase account would you like to use? xxx@gmail.com
✔ Preparing the list of your Firebase projects
? Please select a project: dlj95-angular-firebase-deploy
✔ Preparing the list of your Firebase WEB apps
? Please select an app: angular-firebase-deploy
✔ Downloading configuration data of your Firebase WEB app
UPDATE src/app/app.config.ts (1456 bytes)
 ELIFECYCLE  Command failed with exit code 1.

If running ng deploy again, same happens

Some notes about the setup:

  • Both project and app are freshly created
  • Chose "Google Analytics" as feature when creating the project.
    • Despite I didn't want that feature. Just wanted to deploy the app
    • Anyways... 👇
  • The project creation step failed. Had to create it through the website.

I think there are two issues here also:

  1. Not being able to successfully deploy on a fresh app by running ng deploy and choosing Firebase (this setup loop)
  2. Having to select a Firebase feature. If you don't select any, the process is interrupted. What if I just want to use Firebase for deployment?

More details:

Angular `ng version` output

angular-firebase-deploy@0.0.0 ng /Users/davidlj95/Code/git/tmp/angular-firebase-deploy
ng "version"

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ △ \ | '_ \ / | | | | |/ _ | '__| | | | | | |
/ ___ | | | | (
| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/

Angular CLI: 18.1.2
Node: 20.12.0
Package Manager: pnpm 9.6.0
OS: darwin arm64

Angular: 18.1.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr

Package Version

@angular-devkit/architect 0.1801.2
@angular-devkit/build-angular 18.1.2
@angular-devkit/core 18.1.2
@angular-devkit/schematics 18.1.2
@angular/fire 18.0.1
@schematics/angular 18.1.2
rxjs 7.8.1
typescript 5.5.4
zone.js 0.14.8

@andreasvg
Copy link

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.json at all. I have tried using Node versions 18.13.0, 18.16.0 and 18.19.1.

As a workaround I was able to copy configuration from a previous project and amend it for my new project, specifically:

  • the deploy section in angular.json
  • the contents of firebase.json
  • the .firebase.rc file

@technokon
Copy link

still happening with lates setup of angular and angular/fire

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants