piyushgarg-dev / piyushgargdev-nextjs

https://piyushgarg.dev
191 stars 1.28k forks source link

Error: Invalid/Missing environment variable: "MONGODB_URI" during login in Next.js application #1720

Open captain-adi opened 1 month ago

captain-adi commented 1 month ago

Describe the bug

I'm encountering an issue with my Next.js application when I click the "Login" button. The page crashes with an error related to the missing environment variable MONGODB_URI. The error is thrown from lib/mongodbAdapter.js, and here's the specific message:

To Reproduce

  1. Run the application locally.
  2. Click on the "Login" button on the login page.
  3. The error message is displayed, and the page fails to load.

Expected behavior

The application should log in successfully and proceed to the next page without crashing.

Screenshots/Videos

Screenshot 2024-10-13 200935

Additional context

No response

Please checkmark the following checklist