Angular Universal SSR not working without builder - @angular/fire:deploy builder cloud functions folder different from default #2773
Unanswered
sanderschnydrig
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello World
I've been struggling for days now to get Angular Universal working on Firebase with Angular 11.2.3 and the latest version of AngularFire namely 6.1.4 in a fresh blank project.
The steps I used to create the project and schematics are:
ng new rro-ssr --strict --routing=true --style=sass
ng add @nguniversal/express-engine
firebase init
ng add @angular/fire
If I'm using
ng deploy
and check out the hosting site it works fine, Angular Universal is doing the Server-Side rendering.But why is there no way to specify the Cloud Functions folder inside Angular? The project I am working on already has Cloud Functions in the default folder called
functions
in the root directory of the Angular application. Also the generated Cloud Functions from the AngularFire SSR builder are using Javascript while our project is using Typescript.As it is, I cannot define two separate folders for Firebase Cloud Functions, and I don't want the
@angular/fire:deploy
builder to overwrite my existing Cloud Functions.Furthermore, if I'm trying to deploy the npm scripts made by Angular Universal (parts of the process are described here https://github.com/angular/angularfire/blob/master/docs/universal/cloud-functions.md ), it somehow is not executing the rewrite as described in the link.
firebase.json
I was using the link in the "Additional Resources" from Fireship: https://fireship.io/lessons/angular-universal-firebase/
Cloud Function
functions/src/index.ts
Problem: Even if I just copy everything the
@angular/fire:deploy
builder is putting inside thedist/{project-name}
folder and executingfirebase deploy
, it's not doing the SSR on the hosting site, if I'm building and deploying manually, and not using the AngularFire SSR builder.The npm script that I'm using in my
package.json
:"deploy": "npm run build:ssr && npm run --prefix functions build:ssr && firebase deploy",
The npm script that I'm using in my
functions/package.json
:"build:ssr": "node cp-angular.js && tsc",
The copy script
functions/cp-angular.js
:Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions