This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
Rewrites + dynamic routes not working in Vercel #7181
Replies: 2 comments 1 reply
-
Ok, so I found this works:
With:
And the working endpoints are:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
This discussion was automatically locked because the community moved to a new site. Please join us at vercel.community |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Problem
I am trying to deploy a project using Python functions following this guide.
For the sake of this discussion, consider the following project structure:
The following
next.config.mjs
:And the following
index.py
:That is, I want to have two serverless functions:
/api/python/dummy
/api/javascript/[slug]/
Everything works correctly in my machine, but when I deploy it to Vercel the dynamic route stops working. That is:
/api/python/dummy
works./api/javascript/[slug]/
works./api/javascript/[slug]/
replacing[slug]
with anything else, doesn't work. What I get is my rendered404
page instead.Fun fact: Vercel says all my functions are correctly deployed.
What I have tried:
/api/javascript/[slug]/index.ts
to something without theapi
to avoid possible naming conflicts.rewrites
withbeforeFiles
rewrites
withafterFiles
rewrites
withfallback
I have also tried paying for the
pro
account to open a support ticket directly with Vercel, but they haven't replied since Monday and this is a huge blocker for me.Has someone seen something similar? This is related, but has no replies.
Example
nextjs-test-pi-rust.vercel.app
Steps to Reproduce
Beta Was this translation helpful? Give feedback.
All reactions