Module Not Found Error for siteSettings on Vercel Build (Works Locally)

41 replies
Last updated: Feb 2, 2026
hi all, im building a nextjs project. my problem is with vercel. im getting a
module not found - can't resolve
error on vercel’s build logs. build is successful locally but not on vercel. i tried to rename the file, change its order in the schema, deleted and reinstalled node_modules and non worked. i double checked the file ans it’s exported properly like other documents. it’s weird that it’s only this file
siteSettings
and i have no idea why. any ideas would be much appreciated
AI Update

This is a common issue that usually comes down to case-sensitivity differences between your local environment and Vercel's build environment. Here's what's likely happening:

The Root Cause:

  • Your local machine (especially on macOS or Windows) has a case-insensitive file system
  • Vercel's build environment uses Linux, which has a case-sensitive file system
  • If you're importing siteSettings but the actual file is named SiteSettings.js (or vice versa), it works locally but fails on Vercel

How to Fix It:

  1. Check your import statement casing - Look at where you're importing the siteSettings schema file. The import path must match the actual filename exactly, including capitalization:

    // If your file is siteSettings.js
    import siteSettings from './siteSettings'
    
    // NOT
    import siteSettings from './SiteSettings'
  2. Check the actual filename - Verify the exact casing of your file in your file explorer or with ls in terminal. Don't trust your IDE's display.

  3. Check the folder path casing too - The same case-sensitivity applies to folder names in the import path.

  4. Verify your schema index file - If you're exporting from an index file (like schemas/index.js), make sure the import there also matches exactly:

    export {default as siteSettings} from './siteSettings'

Quick Debug Steps:

  • Run git ls-files | grep -i sitesettings to see exactly how Git has tracked the filename
  • Check your schemas/index.js (or wherever you're aggregating schemas) for the import statement
  • Look for any dynamic imports or require statements that might reference this file

Since you mentioned it works locally but not on Vercel, and you've already tried reinstalling dependencies, case-sensitivity is almost certainly the culprit. Even a single character difference in capitalization will cause this exact error pattern.

Show original thread
41 replies

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?