3

I am serving "react-native start" command in my project and it gives me below error.

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

I have found above problem solution here.

But the problem is when i am trying to navigate to "node_modules\metro-config\src\defaults\blacklist.js" this path there is no such folder named "metro-config".

I did remove the node_modules and re-install them again but the problem is still same.

amit semwal
  • 345
  • 3
  • 16

2 Answers2

4

You can find blacklist.js file in this location as well, node_modules/metro/src/blacklist.js. Make same changes in that file.

Replace

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

with

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

I fixed it just last night.

gprathour
  • 14,813
  • 5
  • 66
  • 90
0

Simple solution->To find metro-config go to you window search bar and type metro-config or directly type blacklist.js and you will find the exact location of file

CH Umer
  • 11
  • 2