Home / Errors / v0 by Vercel / module-not-found-export

v0 'Module not found: Can't resolve @/components/ui/...' after export

v0 by Vercel Moderate 15-45 minutes Last verified Jul 17, 2026
The fix  Run `npm install && npm run build` locally and read the first 'Module not found' line. Install each missing shadcn/ui component with `npx shadcn@latest add <name>`, delete invalid entries like '@/components' from package.json dependencies, pin the Tailwind version the generated code actually uses, and match import paths to file casing exactly. v0's sandbox hid all four problems.

Symptoms

  • "Module not found: Can't resolve '@/components/ui/...'" on the first local or Vercel build after export
  • npm install fails because package.json lists '@/components' as a dependency
  • `npx shadcn@latest add date-picker` says the component isn't in the registry
  • The build errors on unknown Tailwind utility classes
  • Everything worked perfectly inside v0's preview

Why it happens

Hallucinated shadcn component names

v0 references shadcn components by names that do not exist in the public registry, so `npx shadcn add` has nothing to install. Inside v0's sandbox those components already existed, which is why the preview worked.

Invalid dependencies in package.json

v0 has emitted entries like '@/components' in the dependencies block. That is a TypeScript path alias, not an npm package, and npm install fails on it.

Tailwind version mismatch

Generated CSS written in v3 syntax fails under a v4 install, and vice versa. Mixing the two produces unknown-utility-class errors at build time.

Filename case mismatches

Imports that pass on macOS, where the filesystem is case-insensitive, fail on Vercel's case-sensitive Linux build environment. The error only shows up once you deploy.

How to fix it

  1. Build locally before you deployRun `npm install && npm run build`. The first 'Module not found' line tells you exactly which import is broken. Fix errors in order; later ones are often side effects of the first.
  2. Install the missing shadcn/ui componentsFor each missing component, run `npx shadcn@latest add <component-name>`. If the registry says the component does not exist, the name was hallucinated. Swap in the closest real registry component, or copy the component code out of the v0 preview manually.
  3. Clean up package.jsonDelete invalid entries like '@/components' from the dependencies block. The '@/*' alias belongs in tsconfig.json under 'paths', so make sure it is defined there instead.
  4. Pin the right Tailwind versionCheck which syntax the generated code uses. If it has tailwind.config.js and @tailwind directives (v3 syntax), pin "tailwindcss": "^3" in package.json, or migrate the config fully to v4 syntax. Do not mix the two.
  5. Match import paths to file casingMake every import path match the file name casing exactly (Button.tsx vs button.tsx). Vercel builds on Linux, which is case-sensitive; your Mac is not, so this class of error hides until the cloud build.

How to prevent it

  • Run `npm run build` locally after every export; never push a fresh ZIP straight to Vercel.
  • Check AI-suggested component names against the shadcn registry before assuming they exist; hallucinated names are a known pattern.
  • Keep one Tailwind major version per project and pin it in package.json.
  • Use consistent lowercase file naming so case-sensitivity differences between macOS and Linux never bite.

Tools that actually fix this

Recommended because they address the failure mode above, not because of the payout. Some are affiliate links; see how we choose.

Frequently asked questions

Why does v0 code work in the preview but fail to build locally?

v0 generates code against its own sandbox, where shadcn/ui components and path aliases already exist. On export those assumptions break: components are missing, package.json can contain invalid entries like '@/components', and the Tailwind version may not match. Building locally with `npm install && npm run build` surfaces each gap as a 'Module not found' error you can fix one at a time.

What does 'component not found in registry' mean when I run npx shadcn add?

It means the component name v0 used does not exist in the public shadcn/ui registry; the name was hallucinated. Pick the closest real registry component and adapt it, or copy the working component code directly out of the v0 preview into your components/ui directory.

Why is '@/components' listed in my package.json dependencies?

That is a known v0 export problem: '@/components' is a TypeScript path alias, not an npm package, so npm install fails on it. Delete it from the dependencies block of package.json and define the '@/*' alias in tsconfig.json under 'paths' instead.

Why does the build pass on my Mac but fail on Vercel?

The usual culprit is filename casing. macOS filesystems are case-insensitive, so an import of 'Button' happily resolves to button.tsx locally. Vercel builds on Linux, which is case-sensitive, so the same import fails there. Make import paths match file names exactly.

Sources

Related errors

The Vibe Oops briefing

One email when something ships to production that should not have. New incidents, new error guides, no filler.