I have currently followed a video on youtube on SSR with firebase functions. And that seems to work perfect. Now i am trying to add some additional functionality to my ssr boilerplate app. I want to add Firebase firestore support so i can get data from firebase firestore. I am getting this error ERROR { Error: Uncaught (in promise): TypeError: app.firestore is not a function
and this only happens in the function (server). Data is retrieved in the frontend but the SSR part is not working because of the function (server) error. I cant seem to find any solution for this. My code can be viewed here: Github_Repository
I cant see what i am missing here and hope posting this question will help.
thanks.
Use externalDependencies = [ "@firebase/app", "@firebase/firestore" ] in angular.json file
Below is the code.
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/market-web/server",
"main": "server.ts",
"tsConfig": "tsconfig.server.json",
"externalDependencies": [
"@firebase/app",
"@firebase/firestore"
]
},
.....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With