File: troubleshooting.md | Updated: 11/15/2025
Hide navigation
Search
Ctrl K
Home Guides EAS Reference Learn
Archive Expo Snack Discord and Forums Newsletter
Copy page
Fixing common issues with Expo Router setup.
Copy page
Missing files or source maps in React Native DevTools
This can happen if your Chrome DevTools has exclusions within its ignore list. To fix the issue, use React Native DevTools :
/node_modules/EXPO_ROUTER_APP_ROOT not defined
If process.env.EXPO_ROUTER_APP_ROOT is not defined you'll see the following error:
Terminal
Copy
- Invalid call at line 11: process.env.EXPO_ROUTER_APP_ROOT First argument of require.context should be a string.
This can happen when the Babel plugin expo-router/babel is not used in the project babel.config.js. You can try clearing the cache with:
Terminal
Copy
- npx expo start --clear
Alternatively, you can circumvent this issue by creating an index.js file in the root of your project with the following contents:
index.js
Copy
import { registerRootComponent } from 'expo'; import { ExpoRoot } from 'expo-router'; // Must be exported or Fast Refresh won't update the context export function App() { const ctx = require.context('./app'); return <ExpoRoot context={ctx} />; } registerRootComponent(App);
Then, update your app's main entry point in package.json:
package.json
Copy
{ "main": "index.js" %%placeholder-start%%... %%placeholder-end%% }
Do not use this to change the root directory (app) as it won't account for usage in any other places.
This can happen when using a custom version of @expo/metro-config that does not enable context modules. Expo Router requires the project metro.config.js to use expo-router/metro as the default configuration. Delete the metro.config.js, or extend expo/metro-config. See Customizing metro
for more information.
If you set up a modal or another screen that is expected to have a back button, then you'll need to add unstable_settings
to the route's layout to ensure the initial route is configured. Initial routes are somewhat unique to mobile apps and fit awkwardly in the system — improvements pending.
app/_layout.tsx
Copy
export const unstable_settings = { initialRouteName: 'index', };