Open aponski opened 1 year ago
This issue does not seem to follow the issue template. Make sure you provide all the required information.
Any solutions?
@aponski I'll look into this.
@davideast Any updates?
I'm facing a similar issue, Is any fix available? @davideast
@davideast Do you have any updates on this issue ?
Still not working; however, if you change the options, you can get it to work on the desired target. Using some sort of prebuild script, one might be able to swap the configurations out.
{
"deploy": {
"builder": "@angular/fire:deploy",
"options": {
"version": 2,
"buildTarget": "app:build:staging",
"serveTarget": "app:serve:staging",
"firebaseProject": "my-awesome-project"
}
}
}
Ohhh! So that's FINALLY the thread that explain why I'm killing myself since two days now...Not even a note in any documentation even half a year after the problem is discovered and documented 😥
@davideast : Can you give any update on this problem ? I would be happy to help if needed, it's clearly a main blocker for newcomers that are moving to Angular 17 with SSR by default. They will all have a bad opinion of the integration if they search for days like me.... (and also I prefer fixing this problem than developing a fix in intern to remove it in some time 😉 )
@RignonNoel I killed a day or two too. I'd like to see a concise, but complete, configuration of the angular.json
, firebase.json
and .firebaserc
files for a project that has development (local emulators), staging (firebase project), production (firebase project). It took a long time to get a working configuration for a project that wasn't brand new. In retrospect, I think most of the issues were related to this flag not working.
I digged a bit more into AngularFire
, Angular-cli
and firebase-tools
codebase to try understand the flow.
There are TWO build of the application, back to back:
AngularFire
, and it works great with the configurations. In fact after some digging it's clear that the param to use configuration
option on ng deploy
function has been added months ago on Angular-cli
. I even double check manually in debug mode and everything is great on that point.firebase-tools
(called via the code inside AngularFire), and this one is not working at all, taking the production
as a default and not taking in account the configuration
.So the problem is that firebase-tools
do not use the build already done by AngularFire
but in place re-trigger a build for nothing. And I don't see any way of "by-passing" the second build.
The project I use is brand new, from angular v17.1, see the config linked to this comment.
@davideast would you have any input on how to make this flow works ? Any snippets, repository example or piece of knowledge would be appreciate. I've multiple project to migrate and I'm beginning to lose my mind between these out of date docs 😭
Note that the AngularFire official documentation I follow is maybe already not well maintained since they speak about ssr
option in the deploy
section of angular.json
despite the fact that on Angular v17.1 the ssr
is now present on the build
section...
Everything changed, @angular-devkit/build-angular:application
replaced @angular-devkit/build-angular:browser
in the default build
configuration, but the doc are totally lost on all these points. I can't bring myself to believe that Google doesn't have documentation on the current state of the project, there must be a source of knowledge for configuring SSR... But where ??!!
ng run platform:deploy:qa
or
ng deploy platform --configuration qa
I'm confused as to why it is building twice. I just pre-rendered 34,000 static routes in about an hour... and now it's doing it again. I'm going to dig in to this a bit too.
I'm using ng deploy and I have the same problem. The ng deploy command takes the correct configuration, but the firebase tools trigger a 2nd deployment and it takes always the production configuration.
Anyone managed to fix this problem?
Later edit: I found a way to make the firebase tools deployment to use the correct configuration. If you set the variable _FIREBASE_FRAMEWORKS_BUILDTARGET=development it will take the development configuration.
But still is the problem that if you use ng deploy, it will run the build twice.
References:
Hello,
I have exactly the same problem. Every time I want to deploy my application with the ng build --configuration development firebase deploy --hosting:development ...
command, the production configuration is deployed.
I have to define a single configuration and manually change the environment.
"deploy": { "builder": "@angular/fire:deploy", "options": { "version": 2, "browserTarget": "my_project_name_angular:build:production", "serverTarget": "my_project_name_angular:server:production", "prerender": "my_project_name_angular:prerender:production" } },
or
"deploy": { "builder": "@angular/fire:deploy", "options": { "version": 2, "browserTarget": "my_project_name_angular:build:development", "serverTarget": "my_project_name_angular:server:development", "prerender": "my_project_name_angular:prerender:development" } },
I tried to use ng deploy from angular-fire, and there I have other problems, it is impossible to use ng deploy
.
If anyone has an idea I'm interested because I've been looking for several days and I've exhausted all the Google posts ^^
same here! please fix!!!! i can help myself by manually copying the desired environment firebase config before deploying, but well, thats not a fix ;)
Version info
Angular: 16.0.0
AngularFire: 7.6.1
Firebase-tools: 12.3.0
How to reproduce these conditions
I'm trying to deploy Angular 16 SSR app with multiple configurations set in angular.json. It seems that command ng deploy --configuration=development ignores --configuration option and always runs production configuration.
Screen from my angular.json file:
When I change "production" configuration name to "prod" in angular.json and run ng deploy --configuration=development I get "Configuration 'production' is not set in the workspace." error. This indicates that ng deploy uses hardcoded "production" configuration?
Expected behavior
ng deploy --configuration=development should build app with proper configuration