Questions tagged [next-connect]

35 questions
0
votes
1 answer

No overload matches this call. TypeScript error while using `next-connect` & `next-iron-session`

I have a project using next-connect & next-iron-session. next-connect by default uses & I'm using where export type AppSession = { session: Session } export type NextIronRequest…
deadcoder0904
  • 7,232
  • 12
  • 66
  • 163
0
votes
1 answer

next-connect TypeError: handlers[(i++)] is not a function

I am trying to implement route->middleware->endpoint api approach in Next.js using 'next-connect' library. Everything was working fine until I added .post() endpoint to the next-connect insance. // pages/api/index import { protect, restrictTo,…
ABDULLOKH MUKHAMMADJONOV
  • 4,249
  • 3
  • 22
  • 40
0
votes
1 answer

Set up routing pages for next-connect

I set up a server with next-connect. Now how can I move requests to the pages folder of my nextjs program? This is my server js file: const nc = require("next-connect"); const {auth} = require("../app/middlewares/auth"); const handler =…
Jack Pate
  • 169
  • 4
  • 15
0
votes
3 answers

Connections are open with MongoDB

I am developing a project with NextJS and store my data with MongoDB and have issues with MongoDB connections. The connection logic is simple: User connects to a page Page contacts my API to get page info My API using middleware gets data from…
ChilTest
  • 461
  • 5
  • 18
0
votes
0 answers

I'm getting a weird error while using "next-connect" in my nextJS project that had fixed itself in dev but is now even worse in prod

As i said in the title i am using a npm package called "next-connect" to structure my api. Every api route that i created suffered from this error. This is the error : Unhandled rejection: TypeError: Cannot read property 'end' of undefined at…
1 2
3