Solve react native error Invalid regular expression: /(.*\\__fixtures


When you run

1
expo start

and found error like below:

1
2
3
4
error Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class.

Metro Bundler process exited with code 1
Set EXPO_DEBUG=true in your env to view the stack trace.

There some advice to downgrade your NodeJS into version 10.

Some solution that works for me is:

Go to node_modules > metro-config > src > defaults > blacklist.js

And change part of `var sharedBlacklist` into :

1
2
3
4
5
6
var sharedBlacklist = [
  /node_modules[\/\\]react[\/\\]dist[\/\\].*/,
  /website\/node_modules\/.*/,
  /heapCapture\/bundle\.js/,
  /.*\/__tests__\/.*/
];

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.