Debug a Build Failure
Workflow for diagnosing and fixing build or compilation errors
CLAUDE.md
When debugging a build failure:
- Read the build error output from the top. The first error is usually the root cause — later errors are often cascading.
- Identify the file and line referenced in the error.
- Check for common causes: missing imports, type mismatches, syntax errors, incompatible dependency versions.
- If the build worked recently, check what changed:
git diffor recent commits. - Try a clean build: delete the build cache, node_modules (if applicable), and rebuild from scratch.
- If a dependency update caused the failure, check the dependency’s changelog for breaking changes.
- Fix the root cause. Don’t suppress warnings or errors with overrides unless you understand the implications.
Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.