Troubleshooting
Common issues and solutions for Anvil.
Installation Issues
"Command not found: anvil"
The CLI isn't in your PATH.
Solution (global install):
pnpm add -g @eddacraft/anvil-cli
# or
npm install -g @eddacraft/anvil-cli
Solution (local install):
pnpm anvil run
# or
npx anvil run
"Cannot find module '@eddacraft/anvil-cli'"
Dependencies not installed.
Solution:
pnpm install
Node Version Error
Anvil requires Node.js 20+.
Solution:
node --version # Check version
nvm use 20 # Switch to Node 20
Configuration Issues
"Configuration file not found"
No anvil.config.json in project root.
Solution:
anvil init
"Invalid configuration"
Config syntax error.
Solution:
# Validate config
anvil config validate
# Common issues:
# - Missing commas
# - Trailing commas (not allowed in JSON)
# - Wrong types (string vs array)
Boundaries Not Working
Boundary patterns not matching files.
Debugging:
# Test pattern matching
anvil debug boundaries src/api/users.ts
Common issues:
- Glob pattern mismatch (
src/apivssrc/api/**) - Wrong path separator on Windows
- Pattern doesn't include file extension
Runtime Issues
Watch Mode Not Detecting Changes
Files changing but Anvil not responding.
Solutions:
-
Check ignore patterns:
anvil config show | grep ignore -
Check file extensions:
{ "watch": { "extensions": [".ts", ".tsx"] } } -
Increase debounce:
{ "watch": { "debounceMs": 500 } } -
Check file system events:
# macOS: fs.inotify limits
# Linux: /proc/sys/fs/inotify/max_user_watches
High CPU Usage
Anvil consuming too much CPU.
Solutions:
- Increase debounce time
- Add more patterns to ignore
- Disable
validateOnTypein VS Code - Check for circular watch triggers
Memory Issues
Out of memory errors.
Solutions:
# Increase Node memory
NODE_OPTIONS="--max-old-space-size=4096" anvil watch
Check for:
- Very large files being scanned
- Many files in watch scope
- Circular dependencies causing infinite loops
Gate Check Issues
False Positives
Anvil flagging code that's actually fine.
Solutions:
-
Add specific suppression with explanation:
// @anvil-ignore AP-003 Using any for JSON.parse result -
Add pattern suppression in config:
{
"suppressions": [
{
"pattern": "src/types/external.ts",
"checks": ["AP-003"],
"reason": "External type definitions"
}
]
}
Missing Issues
Anvil not catching problems it should.
Check:
# Verify check is enabled
anvil config show | grep -A5 antiPatterns
# Run verbose
anvil run --verbose
Architecture Check Slow
Boundary validation taking too long.
Solutions:
-
Reduce
maxDepth:{ "architecture": { "maxDepth": 5 } } -
Add more specific patterns (less files to scan)
-
Ensure node_modules is ignored
CI Issues
Exit Code Always 0
Anvil passing when it should fail.
Check:
--ciflag is presentfailOnWarningssetting if using warnings- Config is being read (check logs)
GitHub Action Timeout
Action taking too long.
Solutions:
- uses: eddacraft/anvil-action@v1
timeout-minutes: 10
Or:
- Enable caching
- Reduce check scope
- Parallelise with matrix
PR Comments Not Appearing
Action runs but no comment.
Check:
github_tokenis provided- Token has
pull-requests: writepermission comment: trueis set
VS Code Extension Issues
Extension Not Loading
No diagnostics appearing.
Solutions:
- Check Output panel → Anvil
- Verify config file exists
- Reload window:
Ctrl+Shift+P→ "Reload Window" - Check extension is enabled for workspace
Diagnostics Stale
Old issues still showing.
Solutions:
Ctrl+Shift+P → "Anvil: Clear Cache"
Or restart VS Code.
Getting Help
Debug Mode
Run with debug output:
DEBUG=anvil:* anvil run
Log Collection
Collect logs for bug reports:
anvil run --verbose 2>&1 | tee anvil.log
Filing Issues
Include:
- Anvil version:
anvil --version - Node version:
node --version - OS and version
- Config file (sanitised)
- Error message and stack trace
- Steps to reproduce
File at: github.com/EddaCraft/anvil-001/issues
Back to: Configuration →