Using firebase with Server components
Unanswered
rex1410 posted this in #help-forum
rex1410OP
Hello all.
I want to use Firebase with app directory. I need to use Firestore, cloud storage and firebase app. I have the following doubts:
Can I create a single instance of the firebase app, firestore db and cloud storage on server side? How can I do this so all my route handlers can access that? Or will each route handler need its own instance of the above 3?
I want to use Firebase with app directory. I need to use Firestore, cloud storage and firebase app. I have the following doubts:
Can I create a single instance of the firebase app, firestore db and cloud storage on server side? How can I do this so all my route handlers can access that? Or will each route handler need its own instance of the above 3?
2 Replies
@rex1410 Hello all.
I want to use Firebase with app directory. I need to use Firestore, cloud storage and firebase app. I have the following doubts:
Can I create a single instance of the firebase app, firestore db and cloud storage on server side? How can I do this so all my route handlers can access that? Or will each route handler need its own instance of the above 3?
they have tutorial
https://firebase.google.com/codelabs/firebase-nextjs#0
and the code example
https://github.com/firebase/friendlyeats-web/tree/master/nextjs-end
https://firebase.google.com/codelabs/firebase-nextjs#0
and the code example
https://github.com/firebase/friendlyeats-web/tree/master/nextjs-end
@Ray they have tutorial
https://firebase.google.com/codelabs/firebase-nextjs#0
and the code example
https://github.com/firebase/friendlyeats-web/tree/master/nextjs-end
Red-faced Warbler
Module not found: Can't resolve 'net'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/.pnpm/firebase-admin@12.0.0_encoding@0.1.13/node_modules/firebase-admin/lib/app/firebase-namespace.js
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/.pnpm/firebase-admin@12.0.0_encoding@0.1.13/node_modules/firebase-admin/lib/app/firebase-namespace.js