Editor Not Opening
Troubleshooting when the editor doesn't open after tapping a component.
Quick Checklist
- ✅ Metro dev server is running
- ✅ Editor command is in PATH
- ✅ File path is correct
- ✅ No firewall blocking localhost
Check Metro Logs
Look for errors in the Metro terminal:
npx react-native start --verbose
You should see logs like:
[RN Dev Inspector] Opening: /path/to/file.tsx:10:5 in code
Verify Editor Command
Test in Terminal
# VS Code
code --version
# Cursor
cursor --version
# WebStorm
webstorm --version
If the command isn't found, install it:
VS Code / Cursor
- Open the editor
Cmd+Shift+P(Mac) orCtrl+Shift+P(Windows)- "Shell Command: Install 'code' command in PATH"
JetBrains IDEs
- Open the IDE
- Tools > Create Command-line Launcher
Set Editor Explicitly
Environment Variable
export REACT_EDITOR=cursor
npx expo start
In Metro Config
metro.config.js
module.exports = withInspector(config, {
editor: 'cursor',
});
In Inspector Component
<Inspector editor="cursor">
<App />
</Inspector>
Check File Paths
Relative vs Absolute Paths
The inspector uses both. Check Metro logs to see which path is being used.
Working Directory
Ensure the cwd option in your metro config matches your project:
// metro.config.js
module.exports = withInspector(config, {
cwd: __dirname,
});
URL Scheme Fallback
If Metro endpoints fail, the inspector falls back to URL schemes.
Enable URL Schemes
VS Code (macOS)
Already enabled by default.
Sublime Text
Install the "Sublime URL Protocol" package.
JetBrains
- Preferences > Tools > Web Browsers
- Enable "Built-in Preview"
Network Issues
Firewall
Ensure localhost:8081 isn't blocked:
# Test connection
curl http://localhost:8081/status
Android Emulator
Android uses a different IP for localhost:
const devUrl = Platform.OS === 'android'
? 'http://10.0.2.2:8081'
: 'http://localhost:8081';
<Inspector devServerUrl={devUrl}>
Custom Port
If Metro runs on a different port:
<Inspector devServerUrl="http://localhost:3000">
Debug the Endpoint
Test the endpoint directly:
curl "http://localhost:8081/__inspect-open-in-editor?file=/path/to/App.tsx&line=10"
Should return:
{"success": true}
Common Error Messages
"File not found"
The file path is incorrect. Check:
- Metro plugin
cwdoption is set correctly - File exists at the specified path
"Failed to launch editor"
The editor command failed. Check:
- Editor is installed
- Command is in PATH
- Try setting
REACT_EDITORexplicitly
"ECONNREFUSED"
Metro server isn't running or wrong port:
npx expo start
Still Not Working?
- Enable verbose logging (if you're debugging the package)
- Check browser console in React Native Debugger
- Open an issue with:
- React Native version
- Editor name
- OS (macOS, Windows, Linux)
- Error messages from Metro