I’ve been developing a NextJS app locally without issue but have hit issues when deploying to Vercel. Specifically, in the Vercel build, I’m hitting this error:
./src/app/dashboard/page.tsx
Module not found: Can’t resolve ‘…/…/components/Chart’
The relative path is valid and has no issue routing in development. I had previously been using the @ alias, again without issue locally, but decided to use a relative import to see if it’d resolve – clearly it has not.
I’ll share this internally and ask for some pointers, but it would also be helpful if you could create a minimal reproducible example for us to dig deeper.
make sure git config core.ignorecase false is set in your environment.
To be clear, the issue appears to be that Vercel’s filesystem is case-sensitive, but the files I checked into version control were not. Here is my file structure:
In dashboard/page.tsx, the following import was working locally, but not on Vercel:
import Chart from '@/components/Chart';
By setting my git config per the instructions above, then deleting and readding the Chart.tsx file (and committing the change at each step), I was able to resolve the issue on Vercel.