2

Every project was working fine untill this Err. I dont know this is due to node upgrade; I tried by downgrading node from latest to stable version but nothing work !! I run my react native project with yarn start

Err: 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
Set EXPO_DEBUG=true in your env to view the stack trace.
Abdul Wahab
  • 185
  • 2
  • 14

3 Answers3

2

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

Find this array:

   var sharedBlacklist = [
  /node_modules[/\\]react[/\\]dist[/\\].*/,
  /website\/node_modules\/.*/,
  /heapCapture\/bundle\.js/,
  /.*\/__tests__\
  ];

And replace it with this

   var sharedBlacklist = [
  /node_modules[\/\\]react[\/\\]dist[\/\\].*/,
  /website\/node_modules\/.*/,
  /heapCapture\/bundle\.js/,
  /.*\/__tests__\
  ];
kenodek
  • 362
  • 1
  • 2
  • 13
1

Things seem to have changed since the previous answer which doesn't work. Open file PROJECT_NAME\node_modules\metro-config\src\defaults\blacklist.js and replace the current var sharedBlacklist to this:

var sharedBlacklist = [/node_modules[\/\\]react[\/\\]dist[\/\\].*/,/website\/node_modules\/.*/,/heapCapture\/bundle\.js/,/.*\/__tests__\/.*/];

SilverTech
  • 399
  • 4
  • 11
1

go to this file node_modules > metro-config > src > defaults > blacklist.js

and find

var sharedBlacklist = [
  /node_modules[/\\]react[/\\]dist[/\\].*/,
  /website\/node_modules\/.*/,
  /heapCapture\/bundle\.js/,
  /.*\/__tests__\/.*/
];

And update with this

var sharedBlacklist = [
  /node_modules[\/\\]react[\/\\]dist[\/\\].*/,
  /website\/node_modules\/.*/,
  /heapCapture\/bundle\.js/,
  /.*\/__tests__\/.*/
];
Amranur Rahman
  • 1,061
  • 17
  • 29