Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Getting Module not found: Can't resolve 'fs' error while sending confirmation email to email address

I am trying to send confirmation mail after signing up with email password with firebase and next.js . I am new to both next.js & firebase so I’m having some difficulties.

The problem is, I am getting a confirmation mail in my email but before I confirm and redirect to the page , it’s automatically redirecting to the homepage. So ultimately there is no point of mail confirmation.

I think somehow the emailVerified is always true which I need to stop.
I have tried with this block of code but not working.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

const res = await createUserWithEmailAndPassword(auth, email, password);
        if (res.user) {
            firebaseAdmin.auth().updateUser(res.user.uid, { emailVerified: false });
            sendEmailVerification(res.user);
            router.push('/');
        }

This is the error I am getting:

./node_modules/@google-cloud/storage/build/src/bucket.js:22:0
Module not found: Can't resolve 'fs'

When I remove firebaseAdmin.auth().updateUser(res.user.uid, { emailVerified: false }); this line, then the error is solved but then I am not getting any confirmation mail.

Can anyone please help with this?

>Solution :

To resolve the Module not found: Can't resolve 'fs' error, install the fs package using this command

yarn add fs

or

npm install fs --save
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading