Module not found: Error: You attempted to import /firebase/app which falls outside of the project src/ directory
I had it working on a different project before and going off that as a reference but I still get this same error. My utils folder is inside the src directory. Can not seem to find out whats going on. Directory image
import { initializeApp } from '/firebase/app'
import { getAuth, signInWithRedirect, signInWithPopUp, GoogleAuthProvider } from '/firebase/auth'
// Your web app's Firebase configuration
const firebaseConfig = {
// api keys //
};
// Initialize Firebase
const firebaseApp = initializeApp(firebaseConfig);
const provider = new GoogleAuthProvider()
provider.setCustomParameters({
prompt: 'select_account'
})
export const auth = getAuth()
export const signInWithGooglePopUp = () => signInWithPopUp(auth, provider)
// Sign-in component //
import { signInWithGooglePopUp } from "../../utils/firebase/firebase.utils";
const SignIn = () => {
const logGoogleUser = async () => {
const response = await signInWithGooglePopUp();
};
return (
<div>
<h1>Sign In</h1>
<button onClick={logGoogleUser}> Sign in with Google</button>
</div>
);
};
export default SignIn;
Via Active questions tagged javascript - Stack Overflow https://ift.tt/m7Z9o1i
Comments
Post a Comment