Mongodb – connect mongoose in nextjs middleware
I'm trying to connect next.js app to mongodb via mongoose in _middeware file(./pages/_middleware.ts ) But I get this error on incoming requests: error - (middleware)node_modulesmongoosedistbrowser.umd.js (1242:0) @ ReferenceError: regeneratorRuntime is not defined How can I fix it?