mongoose and its models in nextjs 14 middleware
Unanswered
Raspberry Horntail posted this in #help-forum
Raspberry HorntailOP
why do i get this error: ⨯ mongoose.connect is not a function | every time i try to connect to mongoose in the middleware file ? and also i cant get its models,
i've searched for a solution on google but all the people that got the same problem didn't have a solution for it so is it an unfixed bug or something or there is something idk about nextjs middleware ?
i've searched for a solution on google but all the people that got the same problem didn't have a solution for it so is it an unfixed bug or something or there is something idk about nextjs middleware ?
4 Replies
Raspberry HorntailOP
Raspberry HorntailOP
.
North Pacific hake
mongoose and many other libraries dont work in middleware, as middleware runs in edge and edge doesnt support it