Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bug? Vercel says import error but local works fine

Github Link

I'm trying to host my SvelteKit portfolio site to Vercel, yet it keeps throwing me the error

RollupError: Could not resolve "../../utilities/isLoggedIn" from "src/routes/admin/+page.svelte"

When I run npm run build locally I have no issues. I've tried 28 different ways of doing it (yes I counted my commits) and nothing works I'm all out of options. Either I'm missing something completely or Vercel has a problem with me. (I've tried both CLI Vercel & Web vercel if that makes a difference). I've also checked for capitals and misspellings. Highly frustrating.

like image 741
Jardo Avatar asked Oct 26 '25 03:10

Jardo


1 Answers

I found a fix from the Vercel team.

One possible cause for this issue is the fact that some filesystems are case-insensitive, however Vercel deployments use a case-sensitive filesystem. Because of this, it is possible that when you change the letter-casing in filenames on your local machine, Git will only pick up changes in your respective static import statements. This would mean that your repository is now syntactically incorrect, resulting in a build error when deploying the repository on the Vercel platform.

TLDR: git config core.ignorecase false

Similar post on SO with same answer HERE

like image 178
Jardo Avatar answered Oct 28 '25 18:10

Jardo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!