banner
Feb 27, 2022
201 Views

Lỗi Invalid regular expression…Unterminated character class khi build lại project expo

Written by
banner

Có cái project reactnative dùng expo 3 năm nay không động vào khách muốn nâng cấp. Tự dưng expostart thì gặp lỗi

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

Google thì ra là do các mẹ làm sai regular expression

https://stackoverflow.com/questions/58268958/i-am-getting-invalid-regular-expression-error-while-running-npm-start/58880918#58880918

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

sửa thành

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

Sửa xong là chạy

Article Categories:
config · dev
banner

Leave a Reply

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