← All errors · LovableLovable & Bolt app errors
Lovable/Vite: Failed to resolve import
Exact error
[plugin:vite:import-analysis] Failed to resolve import "@/components/ui/x" from "src/..." Does the file exist?
What it means
Vite cannot find a file the code imports, often after the AI renamed or deleted a component.
Likely causes
- AI edit removed or renamed a file but left the import.
- Missing shadcn/ui component file.
- Case mismatch in the file name.
How to fix it
Check the file exists at the path (the @ alias maps to src/ in Lovable projects).
Ask Lovable explicitly: "Create the missing file src/components/ui/x.tsx" or restore it from version history.
If editing locally, add a missing shadcn component:
npx shadcn@latest add dialog
Prevent this next time
- Connect the project to GitHub so every AI edit is versioned and reversible.
- Run `npm run build` locally or in CI before deploying an exported project.
FAQ
What does "Lovable/Vite: Failed to resolve import" mean?
Vite cannot find a file the code imports, often after the AI renamed or deleted a component.
What usually causes it?
AI edit removed or renamed a file but left the import. Missing shadcn/ui component file. Case mismatch in the file name.
How do I fix it?
1. Check the file exists at the path (the @ alias maps to src/ in Lovable projects). 2. Ask Lovable explicitly: "Create the missing file src/components/ui/x.tsx" or restore it from version history. 3. If editing locally, add a missing shadcn component:
Related errors
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy