First Help Post: Local Build Different Than in Vercel
Answered
English Angora posted this in #help-forum
English AngoraOP
This is my first post. I have a NextJS 14.1 + Prismic CMS project. All has been dandy. I pushed a small code update to the GH repo today (BingSiteAuth.xml - that's it). I noticed that my /blog and /projects routes return a 404 error. However, when I run:
My local build shows the /blog and /projects routes without error.
Ok, perhaps this is a sneaky cache bug, I think to myself. So I purge the cache in Vercel and trigger a redeploy. No dice. Still have the 404 errors.
Ok, maybe it's me trying to be "fancy" and use bun. So I create a yarn branch and push that. The preview of the yarn branch builds and still has 404 errors.
Ok, I'm losing my mind I guess. So I do a "sanity check" and run over to my old friend Netlify. I spin up a project using the same GH repo. The build completes and I can visit the /blog and /projects routes without any 404 errors.
What am I supposed to do with that?
bun run build && bun startMy local build shows the /blog and /projects routes without error.
Ok, perhaps this is a sneaky cache bug, I think to myself. So I purge the cache in Vercel and trigger a redeploy. No dice. Still have the 404 errors.
Ok, maybe it's me trying to be "fancy" and use bun. So I create a yarn branch and push that. The preview of the yarn branch builds and still has 404 errors.
Ok, I'm losing my mind I guess. So I do a "sanity check" and run over to my old friend Netlify. I spin up a project using the same GH repo. The build completes and I can visit the /blog and /projects routes without any 404 errors.
What am I supposed to do with that?
Answered by English Angora
Rather than passing searchParams to a child component, I pulled out the property I needed and passed that instead. That seems to have resolved the issue on Vercel. Still concerning that server errors can't be checked locally.
2 Replies
English AngoraOP
I've dug around some more. It appears that on Vercel, I get a 500 error now that says
Why would I get that error on Vercel but not locally when I run the production build and then start?
Page changed from static to dynamic at runtime /blog, reason: searchParams.pageWhy would I get that error on Vercel but not locally when I run the production build and then start?
English AngoraOP
Rather than passing searchParams to a child component, I pulled out the property I needed and passed that instead. That seems to have resolved the issue on Vercel. Still concerning that server errors can't be checked locally.
Answer