Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FirebaseAdapter is not a function? #5635

Closed
RonAlmog opened this issue Oct 24, 2022 · 1 comment
Closed

FirebaseAdapter is not a function? #5635

RonAlmog opened this issue Oct 24, 2022 · 1 comment
Labels
firebase @auth/firebase-adapter triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@RonAlmog
Copy link

Environment

next, react, next-auth, @next-auth/firebase-adapter

Reproduction URL

nope

Describe the issue

using the latest version of @next-auth/firebase-adapter (1.0.2) is producing an error:
export const authOptions = {
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
})
],
adapter: FirebaseAdapter({ db, ...firestoreFunctions }),
}
...
export default NextAuth(authOptions);

and the error is:
error - (api)/pages/api/auth/[...nextauth].js (43:27) @ eval
error - TypeError: (0 , next_auth_firebase_adapter__WEBPACK_IMPORTED_MODULE_6_.FirebaseAdapter) is not a function
at eval (webpack-internal:///(api)/./pages/api/auth/[...nextauth].js:64:90)

going back to the @experimental version, works. but I want to use the latest, of course.

How to reproduce

normal nextjs installation.
[...nextauth].js in the normal place, /pages/api/auth

separate file for all firebase stuff (firebase.config.ts), ending with :

const app = getApps.length > 0 ? getApp() : initializeApp(firebaseConfig);
const db = getFirestore(app);
const storage = getStorage(app);

export { app, db, storage };

in [...nextauth].js you can see:
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
// ... add more providers here
],
adapter: FirebaseAdapter({ db, ...firestoreFunctions }),
...

Expected behavior

should show the google login button, and when logged in, to store the user's info in firebase.
instead i'm getting the error about FirebaseAdaptor being 'not a function'. which is weird, because i checked the code, and it definitely is...

@RonAlmog RonAlmog added the triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. label Oct 24, 2022
@github-actions github-actions bot added the firebase @auth/firebase-adapter label Oct 24, 2022
@balazsorban44
Copy link
Member

duplicate of #5551

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
firebase @auth/firebase-adapter triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

2 participants