Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

243
Views
GetUserByProviderAccountIdError with Google & Firebase Adapter Next Auth

I was trying to use Google Provider with Firebase Adapter in Next Auth, Once I select an account I get the following error:

I am using Firebase 9

TypeError: client.collection is not a function
        at getUserByProviderAccountId (C:\Users\veer4\Documents\Hridaya\Learning\Programming\React JS\google-docs\node_modules\@next-auth\firebase-adapter\dist\index.js:49:26)       
        at acc.<computed> (C:\Users\veer4\Documents\Hridaya\Learning\Programming\React JS\google-docs\node_modules\next-auth\dist\adapters\error-handler.js:19:22)
        at Object.callback (C:\Users\veer4\Documents\Hridaya\Learning\Programming\React JS\google-docs\node_modules\next-auth\dist\server\routes\callback.js:72:51)
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (internal/process/task_queues.js:93:5) {
      name: 'GetUserByProviderAccountIdError'
    }

My pages/api/[...nextauth].js

import NextAuth from "next-auth"
import GoogleProvider from 'next-auth/providers/google'
import { db } from "../../../firebase-config"
import { FirebaseAdapter } from "@next-auth/firebase-adapter"

export default NextAuth({
    // Configure one or more authentication providers
    providers: [
        GoogleProvider({
            clientId: process.env.GOOGLE_CLIENT_ID,
            clientSecret: process.env.GOOGLE_CLIENT_SECRET,
        }),
    ],
    adapter: FirebaseAdapter(db),
})
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

For anyone experiencing the same issue, First off to check your firestore rules if user has read and write access. read more

about 4 years ago · Juan Pablo Isaza Report

0

const firestore = (
  firebase.apps[0] ?? firebase.initializeApp(/* here you should pass your config object */)
).firestore()

Your db should look exactly like firestore const, I am not sure if it looks the same, maybe you should update your question if it doesn't look like this.

https://next-auth.js.org/adapters/firebase

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!