-
Notifications
You must be signed in to change notification settings - Fork 26k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrites not working on Vercel (in production) NextJS #28863
Comments
Hi, can you provide a deployment URL or repo with a minimal reproduction where you are seeing this not work as expected? If you would like to provide this privately you can reach out here |
I got this issue as well with the |
Hi this appears to be working correctly in the latest version of Next.js |
Hi,
I was using nextjs 11.1.2 all along. It does not work. Please reopen this issue.
Thanks for the tip regarding beforeFiles by the way.
Best,
michel
On 19 September 2021 19:24:30 CEST, JJ Kasper ***@***.***> wrote:
Hi this appears to be working correctly in the latest version of Next.js `v11.1.2`, please update and give it a try! Also note: if the API rewrite is added in `beforeFiles` it doesn't need to also be added in the other rewrite types.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#28863 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
It does not work with |
Ah I see, this seems to be a duplicate of #28921 then since it's specific to i18n so we can use that issue for tracking this, thanks for the replies! |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
11.1.0
What version of Node.js are you using?
14.17.4
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
I have been trying to get Rewrites working in NextJS for my API Paths. It was to avoid CORS issues.
I followed the solution from: https://stackoverflow.com/questions/65058598/nextjs-cors-issue.
It is working on localhost but does not work in a production environment (I was deploying on Vercel itself).
I basically tried with all the types of rewrites:
This rewrite works on localhost but on production, the rewrite stops working and the API calls go to
/api/:path*
itself.Expected Behavior
The redirects are working locally but not working in production (ie. Vercel).
To Reproduce
Add the
next.config.js
given above and make API calls on client-side using/api/:path*
This isn't working after building the project.
The text was updated successfully, but these errors were encountered: