StyledFirebaseAuth not working with nextjs
See original GitHub issueI’m trying to get StyledFirebaseAuth to work with NextJS but I keep running into the following issues:
in the terminal when running next dev
wait - compiling /_error (client and server)...
error - ./node_modules/firebaseui/dist/firebaseui.css
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/react-firebaseui/FirebaseAuth.js
and in the browser
Module not found: Package path ./compat is not exported from package /Users/paymahn/code/lookieloo/node_modules/firebase (see exports field in /Users/paymahn/code/lookieloo/node_modules/firebase/package.json)
2 | import {StyledFirebaseAuth} from "react-firebaseui";
3 | import {auth} from "../lib/firebase";
> 4 | import firebase from "firebase/compat";
5 | import 'firebase/compat/auth';
Here’s the entire tsx file I’m using to make a login page:
import React from 'react';
import {StyledFirebaseAuth} from "react-firebaseui";
import {auth} from "../lib/firebase";
import firebase from "firebase/compat";
import 'firebase/compat/auth';
const uiConfig = {
signInFlow: 'popup',
signInSuccessUrl: '/',
signInOptions: [
firebase.auth.EmailAuthProvider.PROVIDER_ID,
],
};
const Login = () => {
return (
<div>
<StyledFirebaseAuth uiConfig={uiConfig} firebaseAuth={auth}/>
</div>
)
}
export default Login
I’ve also tried using FirebaseAuth
instead of StyledFirebaseAuth
but that results in the same issue.
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
Next.js Sign In page with Firebase UI (and Firebase Auth)
Before we begin, this blog assumes you already have a Firebase account and app set up. If you haven't yet, you can go...
Read more >Issue while implementing firebaseUi auth in a nextjs project ...
I tried but not working. Nothing shows up on the page. I think the FirebaseUi integration is not mature for Nextjs.
Read more >Upgraded to React 18, updated dependencies, fixed "AuthUI ...
If you need FirebaseAuth instead of the StyledFirebaseAuth , you can just remove the import ... StyledFirebaseAuth not working with nextjs #180.
Read more >The Ultimate Guide To Firebase With Next.JS - Jarrod Watts
Learn How To Set Up Firebase With Next JS And Create A Cloud Firestore Database, GitHub Authentication, and Firebase Cloud Functions in Next...
Read more >FirebaseUI for Web — Auth - Firebase Open Source
Firebase and FirebaseUI do not work when executed directly from a file (i.e. opening the file in your browser, not through a web...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can we please get an updated version of this module to work with Nextjs without using Firebase compatibility modules? Next Auth is too complicated.
You can have a look at the solution here: https://github.com/firebase/firebaseui-web-react/pull/173#issuecomment-1215648239