Next.js Discord

Discord Forum

App routes work fine locally but not on production

Answered
Asiatic Lion posted this in #help-forum
Open in Discord
Asiatic LionOP
I just deployed my app on vercel. It is working fine but some routes are not working as you can see here. https://portfolio-of3e.vercel.app/

Here's the codebase https://stackblitz.com/edit/nextjs-mrkcuj?file=README.md

The app completely works as expected locally. Even after building it it runs completely okay but some routes give 404 soon after I deploy it. I have tried changing the root folder while deploying. The preset is already next js. I have tried redeploying the project multiple times but nothing worked.
Answered by joulev
the issue is due to casing
View full answer

16 Replies

Asiatic LionOP
Next JS version @ latest
Answer
locally both work because your OS has a case-insensitive system
so blog and Blog are treated the same way
but on vercel, the OS (linux) is case-sensitive, which means Blog and blog are different
and as you see here, the folder name is Blog uppercase not blog lowercase
you have to rename the folder so that it shows up as lowercase on github/stackblitz/etc
Asiatic LionOP
Ohh thanks didn't know about that. Interesting bug. But why is it capital? From what I can see I created them in lowercase (as in the attached photo). I think maybe it is because I'm using Windows that's why it shows in lowercase but then why is my 'project' folder small on Stackblitz? I can change the folder name of the uppercase ones to lowercase on GitHub and I think it will work but that will be a bad fix because every time I will push it I'll have to reupdate it there.
Asiatic LionOP
Doesn't work. Just renamed the 'files' and now it says file not found. Tried the recursive also but same thing
then idk because i don't use windows, but the root cause is casing as you see
@joulev then idk because i don't use windows, but the root cause is casing as you see
Asiatic LionOP
Yeah, thanks I'll try to fix this. Thanks for the help!!
Asiatic LionOP
Ohh yeah fixed it.
Had to use GitHub vs code web interface though so won't call it a fix.