[bug][ios] main.jsbundle Invalid regular expression: Quantifier has nothing to repeat
See original GitHub issueDescription
running in ios results to this error: main.jsbundle Invalid regular expression: Quantifier has nothing to repeat
It’s referring to this:
var matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
I found that there are 2 packages that has this code:
node_modules/pretty-format/node_modules/ansi-styles/index.js
node_modules/expect/node_modules/ansi-styles/index.js
https://github.com/chalk/ansi-styles/blob/main/index.js#L132
I have tried all that I can but can’t find a way to fix this.
Version
0.66.1
Output of react-native info
System:
OS: macOS 11.6
CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
Memory: 439.20 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.11.1 - /var/folders/zg/f6_98ss10lj5b841clyhsxlh0000gn/T/yarn--1634821924400-0.18107403147458956/node
Yarn: 1.22.16 - /var/folders/zg/f6_98ss10lj5b841clyhsxlh0000gn/T/yarn--1634821924400-0.18107403147458956/yarn
npm: 8.0.0 - ~/.nvm/versions/node/v16.11.1/bin/npm
Watchman: 2021.10.11.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.2 - /Users/aprilmintacpineda/.rvm/gems/ruby-3.0.2/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
Android SDK:
API Levels: 24, 26, 28, 29, 30, 31
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
System Images: android-24 | Google Play Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6953283
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_292 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.1 => 0.66.1
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps to reproduce
build on ios
Snack, code example, screenshot, or link to a repository
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (1 by maintainers)
Top Results From Across the Web
Javascript + Regex = Nothing to repeat error? - Stack Overflow
I'm trying to see if the user's input has illegal characters in it by using the .search function as so: if (name.search("[\[\]\?\*\+\|\{\} ...
Read more >How to Fix 'Nothing to repeat' Errors in JavaScript - Webtips
In order to fix the error, locate where the error is originating from, and then verify that the regular expression that you are...
Read more >Solved: Invalid Regex Error React Native | by Shreyas Nisal
Problem solved! Just remember that you would have to change the code in blacklist.js every time you run the npm install command.
Read more >"Invalid quantifier" error message shows wrong part of regexp
These days, the testcase just says "invalid quantifier". Chrome says "Invalid regular expression: /(a**cd)/: Nothing to repeat". Flags: in-testsuite?
Read more >Problem from version`5+` to Regex when using ... - Issuehunt
Problem from version`5+` to Regex when using ReactNative Hermes engine #76 ... failing because Invalid regular expression: Quantifier has nothing to repeat.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, there is another solution by @neildhar:
Modify your
babel.config.js
like so:If you try out this solution could you please report back if that works for you and your setup?
Hey @hatem-72 , @yberstad , I was able to build my app on Android by disabling Hermes. Previously, I was always able to build no problems but something happened in the repo that now fails any build due to this very line:
Did any of you resolve the issue? any clue on how to use turn back on Hermes with RN without getting this error?