serverless-next.js icon indicating copy to clipboard operation
serverless-next.js copied to clipboard

Cannot build with middleware and target: serverless

Open revmischa opened this issue 2 years ago • 1 comments

I don't know if this is a serverless-next issue but this warning has become an error for me in the latest nextjs

> Build error occurred
MiddlewareInServerlessTargetError: Next.js Middleware is not supported in the deprecated serverless target.
Please remove `target: "serverless" from your next.config.js to use Middleware.

And my next.config.mjs is empty

Originally posted by @revmischa in https://github.com/serverless-nextjs/serverless-next.js/issues/2329#issuecomment-1213421647

revmischa avatar Aug 13 '22 00:08 revmischa

Bump.

johnymanuelli avatar Sep 04 '22 09:09 johnymanuelli

+1

mr-rpl avatar Oct 12 '22 21:10 mr-rpl

I'm working on a new setup that will solve this: https://github.com/jetbridge/cdk-nextjs

revmischa avatar Oct 13 '22 00:10 revmischa