Paste an error to match it against the wiki. / 粘贴报错后自动匹配。
Error text / 报错原文
Rollup failed to resolve importCould not loadENOENT: no such file or directory
What it means
The production build cannot resolve a module path that worked in local dev, commonly after AI-generated file moves or path aliases.
Most common causes
- File name casing differs between Windows/macOS and Linux deploy
- tsconfig paths are not wired into Vite
- AI generated an import to a file that was never created
- Dependency is missing from package.json
Fastest fix
- Check the exact imported path and file casing
- Run npm run build locally
- Install vite-tsconfig-paths if relying on tsconfig aliases
- Commit missing files and lockfile
Safe fix
- Run production build in CI on Linux
- Keep path aliases in one config source
- Use git diff to verify generated files exist
- Add dependency checks before deployment
What not to do
- Do not rename files only by casing on Windows without checking Git
- Do not add random dependencies until the missing import is identified
- Do not ignore local build warnings
How to confirm the fix
Run the smallest reproducible command first, then retry the agent task only after authentication, quota, and tool discovery are stable.
npm run build git ls-files | sort node --version
Related errors
- vite: not found / tsc: not found after NODE_ENV=production in Docker →
- Environment variables not working in Cloudflare Workers / wrangler →
- You've hit your session limit / weekly limit - Claude Code →
- Prompt is too long - Claude Code context window →
- Not logged in - Please run /login - Claude Code →
- API Error: Repeated 529 Overloaded errors - Claude Code →