Troubleshooting
This guide covers common issues you may encounter when using React Scanner Studio and how to resolve them.
Common Issues
Configuration Not Found
Error:
╭─────────────────────────────────────────────╮
│ Configuration Not Found │
│ │
│ react-scanner.config.js not found. │
│ Run react-scanner-studio init first to │
│ create the configuration. │
╰─────────────────────────────────────────────╯Cause: The react-scanner.config.js file is missing from your project root.
Solution:
- Run
npx react-scanner-studio initto create the configuration file - Or manually create
react-scanner.config.jsin your project root
Scan Data Not Found
Error:
╭─────────────────────────────────────────────╮
│ Scan Data Not Found │
│ │
│ Scan data file not found: │
│ .react-scanner-studio/scan-report.json │
│ │
│ Run npx react-scanner first to generate │
│ the scan data. │
╰─────────────────────────────────────────────╯Cause: The scan data file hasn't been generated yet.
Solution:
- Run
npx react-scannerto scan your codebase - Verify that the
outputTopath in your config matches what React Scanner Studio expects
Missing Dependency: react-scanner
Error:
╭─────────────────────────────────────────────╮
│ Missing Dependency: "react-scanner" │
│ │
│ react-scanner is not installed. │
│ This package is required to analyze your │
│ React components. │
╰─────────────────────────────────────────────╯Cause: The react-scanner package is not installed in your project.
Solution:
# Using npm
npm install --save-dev react-scanner
# Using yarn
yarn add --dev react-scanner
# Using pnpm
pnpm add --save-dev react-scannerPort Already in Use
Error:
⚠ Port 3000 is not available.
? Would you like to run on port 3001 instead? (Y/n)Cause: Another process is already using the requested port.
Solutions:
Accept the alternative port — Press Enter to use the suggested port
Specify a different port:
bashreact-scanner-studio start --port 8080Find and kill the process using the port:
bash# On macOS/Linux lsof -i :3000 kill -9 <PID> # On Windows netstat -ano | findstr :3000 taskkill /PID <PID> /F
No Components Found
Symptom: The dashboard shows no components or empty data.
Possible Causes and Solutions:
Wrong
crawlFrompath- Verify the path in
react-scanner.config.jspoints to your source directory - Use a relative path from your project root (e.g.,
./src)
- Verify the path in
Wrong
importedFromvalue- Ensure
importedFrommatches how components are imported in your code - Check the exact package name (e.g.,
@mui/materialnotmaterial-ui)
- Ensure
Files are excluded
- Check if your source files match the glob patterns
- Verify files aren't in the
excludearray
No matching imports
- Open a source file and verify the import statement matches
importedFrom
js// If importedFrom is '@mui/material' import { Button } from '@mui/material'; // ✓ Will be tracked import Button from './Button'; // ✗ Won't be tracked- Open a source file and verify the import statement matches
Build Fails with Vite Error
Error:
✖ Vite build failedPossible Causes and Solutions:
Node.js version too old
- Ensure you're using Node.js 18.0 or higher
bashnode --versionCorrupted node_modules
- Delete
node_modulesand reinstall
bashrm -rf node_modules npm install- Delete
Permission issues
- Ensure you have write permissions to the output directory
bashchmod -R 755 .react-scanner-studio
Dashboard Shows Stale Data
Symptom: The dashboard doesn't reflect recent code changes.
Cause: The scan data is outdated.
Solution:
- Re-run the scanner to update the data:bash
npx react-scanner - Refresh the dashboard or restart the server:bash
react-scanner-studio start
EACCES Permission Error
Error:
Error: EACCES: permission deniedCause: Insufficient permissions to read/write files.
Solutions:
Fix directory permissions:
bashsudo chown -R $(whoami) .Use a different output directory: Update the
outputTopath in your config to a writable location.Run with elevated permissions (not recommended):
bashsudo npx react-scanner-studio start
ES Module Errors
Error:
Error: require() of ES Module not supportedCause: Mixing CommonJS and ES modules incorrectly.
Solution: Ensure your react-scanner.config.js uses CommonJS syntax:
// ✓ Correct (CommonJS)
module.exports = {
crawlFrom: './src',
// ...
};
// ✗ Incorrect (ES Module)
export default {
crawlFrom: './src',
// ...
};Getting Help
If you're still experiencing issues:
Check the GitHub Issues
- Open Issues
- Search for similar problems
Open a New Issue
- Provide your Node.js version:
node --version - Include your
react-scanner.config.js - Include the full error message
- Describe the steps to reproduce
- Provide your Node.js version:
Join the Community
See Also
- Installation — Installation guide
- Configuration — Configuration reference
- CLI Commands — Command reference
