Reputation: 4582
I got an issue when starting my React Native project using expo start
.
The browser opens up and shows me the following page:
After about a second the page goes dark completely and the following error appears in the console (with EXPO_DEBUG=true
set):
Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
error Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class. Run CLI with --verbose flag for more details.
Metro Bundler process exited with code 1
Error: Metro Bundler process exited with code 1
at ChildProcess.<anonymous> (C:\@expo\[email protected]\src\Project.ts:1804:16)
at Object.onceWrapper (events.js:300:26)
at ChildProcess.emit (events.js:210:5)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I'm running Windows 10 1903 x64, NodeJs v12.11.0 and the following dependencies:
"dependencies": {
"expo": "^35.0.0",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-web": "^0.11.7"
},
"devDependencies": {
"@types/react": "^16.8.23",
"@types/react-native": "^0.57.65",
"babel-preset-expo": "^7.0.0",
"typescript": "^3.4.5"
}
Any idea what to do now?
Upvotes: 3
Views: 4808
Reputation: 53
I had this issue too after updating NodeJS to 12.13. I downgraded to 10.17 and it's working back again.
Upvotes: 0
Reputation: 836
just need to change some hashes on your project: Go to : \node_modules\metro-config\src\defaults\blacklist.js
var sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
to this :
var sharedBlacklist = [
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
Upvotes: 12
Reputation: 11
Uninstall latest Node version
And reinstall Node Version 10.16.3
It should work.
Upvotes: 0
Reputation: 58
I was running Windows 10 with Node LTS version v10.16.3 and it was working fine. I changed to Node Current Version v12.11.0 and I got the same error. Reverted back to Node LTS version v10.16.3 and it is all working fine again.
I also upgraded the Expo cli to from 3.1.2. to 3.2.3. Just in case I reverted to the earlier version again (it is only 12 days old) npm -g i [email protected].
You can try that as well if changing your Node version doesn't work.
After the above changes, everything is working smoothly again.
Upvotes: 3