sladg / nextjs-lambda

Lambda deployments for Nextjs12 & Nextjs13 (standalone). Easy CLI commands to get your standalone Next output to run in AWS Lambda (not @Edge)! Uses CDK in behind and produces code zips importable to Terraform, Serverless, Azure, etc.
MIT License
169 stars 19 forks source link

Is middleware supported? #59

Closed khuezy closed 1 year ago

khuezy commented 1 year ago

I see a middleware checkmark in the list of features, but when I deploy the example: https://github.com/vercel/next.js/tree/canary/examples/middleware, it doesn't actually work.

Edit: it does work when you reload the browser, but using <Link />, it does not work.

sladg commented 1 year ago

Hey! Yes, we tested middleware.ts on Next@12.3, and redirects worked fine, moreover, redirects also work by specifying them in next.config.js. Can you share your expected result compared to the current state? <Link/> is not used in middleware.ts, so I'm not 100% sure where to look.

khuezy commented 1 year ago

Hi thanks for replying, redirect is working for me now. I must have messed up somewhere.