-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Deploying Angular ssr to firebase #2948
-
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 **
Expected behavior
Actual behavior
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 5 replies
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
👎 1
-
Are you using intending to reply?
See attached image I uploaded my cloud functions already and can't using ng deploy with CI systems
Beta Was this translation helpful? Give feedback.
All reactions
-
But you're not calling ng deploy? in the pasted example, you're manually calling firebase deploy
Beta Was this translation helpful? Give feedback.
All reactions
-
So how to use ng deploy with CI systems like GitHub Actions
Beta Was this translation helpful? Give feedback.
All reactions
-
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 ?
Beta Was this translation helpful? Give feedback.
All reactions
-
@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.
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.