Open myrjola opened 3 years ago
Yes it seems Next.js might have recently added rewrites object format? I didn't recall it when I first implemented rewrites. So it would need to be implemented. I'm working on some other stuff at the moment but can tag this as good first issue / enhancement in case someone wants to pick it up.
Hello, I would like to contribute and can i start by taking this task ?
@seifeddinebesbes Yes! I think no one else is working on it at the moment. Definitely let us know if you need help to get started or you can join the slack as well (email us at serverlessnextjs@gmail.com)
@dphang thank you and i already sent you an email :) :)
Best regards, Seif
Having the same issue. Is there any workaround currently or is downgrading to Next 9 the best option til this is fixed?
@zburk you can use the old rewrites configuration without downgrading to Next9 for example :
Are there any logs created for rewrites? I tried setting it up and keep getting a 404 error. If I deploy the exact same code to Vercel, it works fine.
Hello, i have the same error, have any updates on this issue?
This is is still happening. Any news?
My scenario is trying to create a dynamic robots
async rewrites() { return { beforeFiles:[{ source: '/robots.txt', destination: '/api/robots', locale: false }] }; },
Describe the bug
The rewrites configuration also supports an object, but this does not currently work in the default Lambda. https://nextjs.org/docs/api-reference/next.config.js/rewrites
Actual behavior
The default Lambda crashes with the following:
Expected behavior
The rewrites should apply without any crash.
Steps to reproduce
Add rewrites with the object format to next.config.js:
When navigating to /fi/varaus, you will get the "rewrites is not iterable" error instead of navigating to the /pages/reservation.tsx page.
Screenshots/Code/Logs
The crash looks like this from the user's perspective:
Versions