Middleware can only use a subset of NodeJS APIs https://github.com/vercel/next.js/discussions/46722
back
1 comments
Middleware is still fully supported when self-hosting. I agree that it would be helpful to have a Node.js route level middleware primitive. This primitive, for "global" middleware, intentionally has a limited runtime.
https://nextjs.org/docs/app/building-your-application/deploy...