ng deploy still doesn't work
Hello,
Are there any plans to fix ng deploy. As it hasn't worked for a while now. The Angular documentation still says it should for deployment.
Thanks, Harris
I believe this was intentionally removed and the guidance now is to follow this to host your angular app on firebase https://firebase.google.com/docs/hosting/frameworks/angular#initialize_a_new_project
That's not the guidance from Angular: https://angular.dev/tools/cli/deployment
This probably depends a lot on your setup, right? Is it just hosting? Functions? Storage? Firestore? I've been using the firebase-tools cli in my CI/CD pipelines for deploying the various components a given project is using.
Also, can you describe what exactly isn't working for you when you run ng deploy? In your specific case, what are you expecting it to do and where is it failing?
It's not working for any new setup. If I start a fresh new Angular project then use ng add @angular/fire, hosting isn't an option. So when you run ng deploy, it just runs ng add @angular/fire again.
Just curious, did you also run firebase init on your project root as well? This is usually required for me to get things up and running correctly. I don't use ng deploy directly, so I can't be of much help here on this front. But I am saying that you can set up deployment, including hosting, if you use the firebase-tools cli, which I think is probably the recommended way to move forward. Can't speak for the authors though. Good luck!
Yeah, that doesn't help. I know you can still deploy with firebase deploy. But the issue I'm raising is that ng deploy doesn't work on an Angular codebase, when it should.
@Harris6144 I'd argue that it does help. I'm offering a path forward, and I think you are just making a stance on something that you know probably won't change any time soon. You do you, but I wouldn't mind still discussing this further.
In your particular case, assuming that ng deploy at least didn't run ng add @angular/fire again, what are you expecting that one single command to do without you initializing the project using firebase-tools? In your particular case, would ng deploy ONLY pertain to hosting? Or would it magically detect what services you were using and deploy all of them that you want it to without asking any questions? What about if you were using cloud functions? In that case, you probably WOULD have initialized your project with the firebase-tools cli. I'm just trying to get a better idea of what you expect ng deploy to do.
I understand that it isn't supposed to run ng add @angular/fire again. But I'll reiterate, I can't reproduce that for the life of me, so I'm just trying to get a better understanding of what it is failing to do on your machine and what you are expecting it to do assuming everything went the way you'd expect.
If all you are trying to do is declare that something doesn't work and leave it at that, then let me know and I'll drop this.
Sorry, I misread. It shouldn’t require firebase-tools.
It use to be, you would run ng add @angular/fire, it would ask you to setup hosting, then you would run ng deploy and it would deploy. This is what the current Angular docs says to do. But it doesn’t work. It says nothing about firebase-tools.
@Harris6144 Thanks for further clarifying. I need to clarify something as well: I'm currently trying to reproduce this, and ng add @angular/fire does exactly what it is supposed to, for me, on my machine. It will ask what services I want to setup and then set them up for me.
But I still need you to clarify something for me: did ng deploy handle deploying anything and everything? Or was it just Hosting?
I've never seen ng deploy support deploying all the other services (namely functions). I just want to confirm what you expect ng deploy to do, in detail, when its working as you'd expect. Then we can confirm that's in alignment with what ng deploy does according to the documentation.
When I speak of using firebase-tools, that is purely to solve the deployment problem. If I read you correctly, you are now reporting two different issues you are having. One with ng add @angular/fire not doing what it is supposed to (which I cannot reproduce and use this on a weekly basis), and two, ng deploy isn't "deploying." Can you confirm that these are the TWO issues you are having? And can you further clarify what "then you would run ng deploy and it would deploy" means in terms of what it actually deployed, in detail?
I'm trying to follow the Angular instructions on deployment, found here: https://angular.dev/tools/cli/deployment
If you start a new Angular & Firebase project and follow the steps there, you'll see the issue. It doesn't deploy.
@Harris6144 I'm going to try to ask the same question one more time. I really appreciate you continuing to respond, but if I can't get you to answer the following question, I think I might let someone else take a crack at responding to your ticket here.
What exactly do you want `ng deploy` to deploy? This includes listing out all the services and functionalities you are intending to deploy like Hosting, App Hosting, Functions, Storage, Firestore, Real-Time Database.
If your issue is with the documentation on Angular's website being wrong, I hardly find it the fault of this @angular/fire library. It seems like you should go create a ticket on the main Angular repository to complain about their documentation not being complete.
I would also suggest you find what ng deploy does according to this library's documentation. You might find that it doesn't do what the Angular.dev website is insinuating. I think you might come to the conclusion that the link you mention, https://angular.dev/tools/cli/deployment is not a fully encompassing tutorial on how to deploy your angular app, but more so an example of different libraries out there that help with that, but ultimately is an over-simplification.
Ng deploy should deploy the Angular app to Firebase. It uploads it so it is accessible on the web. For example, other options on there are GitHub pages, which would upload it to GitHub so it's accessible there.
@Harris6144 I'm sorry that you keep ignoring the question. I really wanted to help you. Good luck.
I'm not ignoring the question at all. You asked what I'm trying to deploy, I told you.
Let me show you what you are ignoring with a survey:
When you run ng add @angular/fire and then immediately run ng deploy, which one of the following is supposed to be deployed to?
- [ ] Hosting
- [ ] App Hosting
- [ ] Firestore
- [ ] Real-Time Database
- [ ] Storage
- [ ] Cloud Functions
None of those, I'm deploying to Firebase.
I'm trying to point out to you that there is much more involved in deploying to firebase UNLESS you are only concerned with a client side angular app that doesn't do anything with firebase yet. In that case, the answer to my question would be "just Hosting." In that case, you would want to show more detail to the community, in your bug report, what exactly ng deploy does instead of deploying your Angular CLI project to Firebase Hosting in the project you are making us all assume exists and was created successfully prior to running ng deploy.
You aren't providing any information to help the community point you in the right direction, which is why I'm making the assumption that you are here just to complain and don't actually want to solve this. Show the error message at the very least.
None of those, I'm deploying to Firebase
I'm sorry, but you need to understand that that list is ALL in Firebase. Deploying to Firebase is something that I think you need to read up more on before you go any further.
I don't understand what more information you need.
Before, you could make a new app in Angular, add angularfire, run ng deploy and it would deploy your app to the web. Not no longer works. There's no other way I can explain that so I guess we'll just have to carry on with it never working.
Would a video help?
@Harris6144 this isn't difficult:
Sure, a video would be great.
If there was an error message, I would have posted one.
Okay, so to summarize:
- You aren't getting an error
-
ng deploy"isn't working" because it is somehow just runningng add @angular/fireagain instead of "deploying to Firebase" - When you run this on your machine, there is literally nothing else that happens on screen that could help someone try to help you resolve this?
Do I have this right?
Would a video help?
A video would still help if you literally don't have anything else you think you can share.
No, you don't have that right.
The original functionality was that when you typed ng deploy, it would ask you to select a project, etc, then it would deploy it. Now it just finishes the command without doing anything.
Thank you for clarifying. A video would still be helpful.
Are you sure there isn't any way to get more verbose output from the command?
It's not working for any new setup. If I start a fresh new Angular project then use
ng add @angular/fire, hosting isn't an option. So when you runng deploy, it just runsng add @angular/fireagain.
Do you see why I was confused? You claimed it runs the ng add @angular/fire command again. Now you are saying it doesn't output anything. So now we have to assume that maybe there is some logging somewhere with more information in it. Can you look for a verbose flag or any log files that were created with some more info?
Sorry, it does come up with ng add options again before finishing without the deploy.
By finishing the command, I meant finishing the ng add command.
Alright. I feel like I'm being trolled here. If you send a video, that'd be helpful. But I can't help you without more information. And if you literally don't have any more information, then I guess we are done here.
I feel the same.
All you have to do is start a new angular project, try add angularfire, try ng deploy and you'll see that it doesn't deploy the Angular app to Firebase.
Looks like I can't share videos here.