Troubleshooting Guide
Common issues and their solutions to speed up development.
Development Environment
Node.js Issues
Error: ENOSPC
# Solution
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
Package Installation Fails
- Clear npm cache
- Delete node_modules
- Delete package-lock.json
- Run npm install
Build Problems
Common Build Errors
TypeScript Errors
// Error: Type 'string' is not assignable to type 'number'
// Solution: Add proper type annotations
const count: number = 5;
Module Not Found
- Check import path
- Verify package installation
- Clear build cache
Runtime Issues
Memory Leaks
React Component Memory Leak
// Problem
useEffect(() => {
const interval = setInterval(() => {
// Do something
}, 1000);
}, []); // Missing cleanup
// Solution
useEffect(() => {
const interval = setInterval(() => {
// Do something
}, 1000);
return () => clearInterval(interval);
}, []);
Performance Issues
- Check bundle size
- Profile with React DevTools
- Analyze render cycles
- Review network calls