[vite] Internal server error: Failed to resolve import "x" from "src/App.jsx". Does the file exist?
Vite couldn’t find an imported file or package.
Seen on:
React
Meaning
Wrong relative path, case mismatch, path alias not configured in vite.config, or package not installed.
Common causes
- Wrong relative path or file extension
- Alias (@/) defined in tsconfig but not in vite.config
- Package not installed
- Case mismatch on Linux CI
⚡ Quick fix
- Fix the path or install the package
- Add resolve.alias in vite.config (or vite-tsconfig-paths)
- Match file name case exactly
Detailed fix by platform
React
resolve: { alias: { '@': path.resolve(__dirname, 'src') } }
How to diagnose
- Import — Which specifier?
- Alias — Configured in Vite?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026