Dynamic Routes Working in localhost but not after Deploying to Vercel
Unanswered
Ragdoll posted this in #help-forum
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.
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
@Ragdoll 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.
idk if this is related to your problem but name of all react components must start with an uppercase letter
Asiatic Lion
maybe same as here?
https://github.com/vercel/next.js/issues/54008
https://github.com/vercel/next.js/issues/54008
(its not only on docker, i have the same error on a windows machine with custom server)