-
Notifications
You must be signed in to change notification settings - Fork 59
Troubleshooting
Common issues and solutions.
Symptoms: Drift falls back to TypeScript (slower), or shows "native not available"
Solutions:
-
Check native module status:
drift --version --verbose # Should show: Native module: β available -
Rebuild native modules:
npm rebuild @drift/native
-
Ensure you have build tools:
- macOS:
xcode-select --install - Ubuntu:
sudo apt-get install build-essential - Windows: Install Visual Studio Build Tools
- macOS:
-
Check Node.js version (18-20 recommended):
node --version # v18.x or v20.x recommended
Symptoms: require is not defined or similar ESM errors
Solutions:
-
This was fixed in v1.0.0. Update to latest:
npm install -g driftdetect@latest
-
If using custom setup, ensure
createRequireis used for native modules
Symptoms: Tree-sitter native modules fail to build
Solutions:
-
Ensure you have build tools installed:
- macOS:
xcode-select --install - Ubuntu:
sudo apt-get install build-essential - Windows: Install Visual Studio Build Tools
- macOS:
-
Try with Node.js 18 or 20 (not 22+):
nvm use 18 npm install -g driftdetect
-
Clear npm cache:
npm cache clean --force npm install -g driftdetect
Solutions:
-
Use global install instead:
npm install -g driftdetect drift init
-
Clear npx cache:
rm -rf ~/.npm/_npx npx driftdetect init
Symptoms: Scan runs for 10+ minutes
Solutions:
-
Check
.driftignoreexcludes large directories:node_modules/ dist/ build/ .git/ vendor/
-
Scan a subdirectory:
drift scan src/
-
Use timeout:
drift scan --timeout 600000
-
Use incremental scanning:
drift scan --incremental
Symptoms: drift status shows 0 patterns
Solutions:
-
Ensure you're scanning source files:
drift scan src/
-
Check language is supported:
drift parser --test
-
Lower confidence threshold:
// .drift/config.json { "patterns": { "minConfidence": 0.3 } }
-
Check file extensions are recognized:
- TypeScript:
.ts,.tsx - Python:
.py - Java:
.java - C#:
.cs - PHP:
.php
- TypeScript:
Symptoms: Scan crashes or exits with error
Solutions:
-
Run with verbose output:
drift scan --verbose
-
Check for syntax errors in your code (Drift handles most, but some crash parsers)
-
Try scanning specific files:
drift scan src/api/
-
Report the issue with the error message: https://github.com/dadbodgeoff/drift/issues
Symptoms: AI agent can't find Drift tools
Solutions:
-
Verify config file location:
- Claude Desktop (macOS):
~/Library/Application Support/Claude/claude_desktop_config.json - Claude Desktop (Windows):
%APPDATA%\Claude\claude_desktop_config.json
- Claude Desktop (macOS):
-
Check JSON syntax:
{ "mcpServers": { "drift": { "command": "npx", "args": ["-y", "driftdetect-mcp"] } } } -
Restart the AI client after config changes
-
Test MCP server manually:
npx driftdetect-mcp # Should start without errors
Symptoms: MCP tools return "scan required" error
Solutions:
-
Run initial scan:
cd your-project drift init drift scan -
Ensure
.drift/directory exists and has data -
Check you're in the right directory
Symptoms: AI takes long time to get Drift data
Solutions:
-
First call is always slower (loading data)
-
Use
drift_statusfirst (lightweight) -
For large codebases, pre-build call graph:
drift callgraph build
-
Enable caching (default):
{ "mcp": { "cache": { "enabled": true } } }
Symptoms: drift callgraph build fails or shows 0 functions
Solutions:
-
Ensure source files are being scanned:
drift scan --verbose
-
Check parser status:
drift parser --test
-
Try building for specific directory:
drift callgraph build src/
Symptoms: drift callgraph reach returns empty results
Solutions:
-
Ensure call graph is built:
drift callgraph status
-
Check the location format:
# File:line format drift callgraph reach src/api/users.ts:42 # Function name drift callgraph reach handleLogin
-
Increase max depth:
drift callgraph reach src/api/users.ts:42 --max-depth 20
Symptoms: drift dashboard fails to open
Solutions:
-
Check port availability:
drift dashboard --port 3001
-
Try without auto-open:
drift dashboard --no-browser # Then open http://localhost:3000 manually -
Check for errors:
drift dashboard --verbose
Symptoms: Dashboard opens but is empty
Solutions:
-
Run a scan first:
drift scan drift dashboard
-
Check
.drift/directory has data
Symptoms: CI never fails even with violations
Solutions:
-
Use
--ciflag:drift check --ci --fail-on warning
-
Ensure patterns are approved:
drift approve --category api --yes drift check --ci
Symptoms: CI fails on every run
Solutions:
-
Lower fail threshold:
drift check --ci --fail-on error # Only fail on errors -
Ignore specific patterns:
drift ignore <pattern-id>
-
Check what's failing:
drift check --format json
Include in your bug report:
- Drift version:
drift --version - Node.js version:
node --version - Operating system
- Error message (full output)
- Steps to reproduce
- Cortex V2 Overview
- Memory Setup Wizard
- Memory CLI
- Universal Memory Types
- Learning System
- Token Efficiency
- Causal Graphs
- Code Generation
- Predictive Retrieval
- Architecture
- Call Graph Analysis
- Impact Analysis
- Security Analysis
- Data Boundaries
- Test Topology
- Coupling Analysis
- Error Handling Analysis
- Wrappers Detection
- Environment Variables
- Constants Analysis
- Styling DNA
- Constraints
- Contracts
- Decision Mining
- Speculative Execution
- Watch Mode
- Trends Analysis
- Projects Management
- Package Context
- Monorepo Support
- Reports & Export
- Dashboard
- 10 Languages
- 21 Frameworks
- 16 ORMs
- 400+ Detectors
- 50+ MCP Tools
- 60+ CLI Commands
- 23 Memory Types