Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deploying Angular ssr to firebase #2948

Unanswered
OmarioHassan asked this question in Q&A
Discussion options

Version info

Angular: ~12.2.0

Firebase: ^9.0.0

AngularFire: 7.0.4

Other (e.g. Ionic/Cordova, Node, browser, operating system):

How to reproduce these conditions

I was using npx firebase deploy --only functions,hosting:user to deploy my user app and it was working well,
Now there is no error after using this command but SSR not working "when try ctrl+u" there is no SSR code there

Failing test unit, Stackblitz demonstrating the problem

Steps to set up and reproduce

Sample data and security rules

Debug output

** Errors in the JavaScript console **

** Output from firebase.database().enableLogging(true); **

** Screenshots **

image

image

Expected behavior

Actual behavior

You must be logged in to vote

Replies: 2 comments 5 replies

Comment options

Are you using intending to use ng deploy or something else? Cause right now it doesn't seem like you're building your server/function bundles.

You must be logged in to vote
3 replies
Comment options

Are you using intending to reply?
See attached image I uploaded my cloud functions already and can't using ng deploy with CI systems

Comment options

But you're not calling ng deploy? in the pasted example, you're manually calling firebase deploy

Comment options

So how to use ng deploy with CI systems like GitHub Actions

Comment options

Hi @jamesdaniels, I have got the same kind of issue when using ng deploy with the ssr and i18n.

With ssr alone, I had in the view source the page content. So it was working as expected (SEO compliant).
When I added i18n with localize package, I had the same behavior as described above, only <app-root></app-root>.
I then tried to localize the server build, but the ng deploy seems to not aknowledge the local folder in dist/server. By looking at the shcematics source code, the deploy builder and actions do not take i18n in account.

Should I open a new issue in that regard ?

You must be logged in to vote
2 replies
Comment options

@kana7 Try using NPM 6.14.15 and use a resolver to load the data before the view is rendered. The older NPM version is not ideal, but Firebase seems to work best when deployed using NPM V6 instead of the newer V7 or V8.

Comment options

Thanks for the reply @firstlinestudio. I am already using the 6.14.15 version. I will check if a resolver give me better results. So far with the new angularfire version, I see that only the data coming from a promise get rendered on the server side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #2944 on September 14, 2021 07:18.

AltStyle によって変換されたページ (->オリジナル) /