Next.js Discord

Discord Forum

Dynamic Routes Working in localhost but not after Deploying to Vercel

Unanswered
Ragdoll posted this in #help-forum
Open in Discord
RagdollOP
Hello, I am new to Next.js and want to understand this error.

On localhost, my dynamic routes are working as expected. However, once I deploy to Vercel I get a 404 when visiting the dynamic routes.

The route I'm using are /edit/[id]/page.tsx. See the images below for all paths.

Also, I noticed that when I run npm run build in the out folder there is no edit directory. Additionally, on the vercel logs I get [GET] /edit/[id] request with a 308 status.

I've tried reading up on getStaticPaths/getStaticProps but I'm not sure if this fits the problem.

I can share the full GitHub repo if requested. Thanks.

3 Replies