Next.js Discord

Discord Forum

Getting MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined".

Answered
Red Crossbill posted this in #help-forum
Open in Discord
Avatar
Red CrossbillOP
I have checked env and even tried with directly putting connection string but still getting the mongoose error. please help me my project got stuck.

this issue started after creating /admin/dashboard/faculty and /admin/dashboard/student route.

before this i also get the mongodb uri problem but it was running fine in development as well as in production.

Reop : https://github.com/Rahulkumar703/Attendence-Manager-Nextjs
Answered by Red Crossbill
SOLVED : there was a silly mistak i have imported the connect function from mongoose instead my database connection function. 😁
View full answer

1 Reply

Avatar
Red CrossbillOP
SOLVED : there was a silly mistak i have imported the connect function from mongoose instead my database connection function. 😁
Answer