Currently I have project which was running on aws amplify. On the local side I can build successfully and start it but. After implemented the middleware and try to deploy with amplify. It caused this error. Couldn't find any solution,
Build error occurred MiddlewareInServerlessTargetError: Next.js Middleware is not supported in the deprecated target. Please remove `target: "" from your next.config.js to use Middleware.
next.config.js
middleware.ts
Amplify doesn't support anything above Next 11
See the conversation here: https://github.com/vercel/next.js/issues/41932