slevithan / xregexp

Extended JavaScript regular expressions
http://xregexp.com/
MIT License
3.31k stars 278 forks source link

Exception on React Native #259

Closed lorenc-tomasz closed 5 years ago

lorenc-tomasz commented 5 years ago

undefined is not a function (evaluating 'optionalFlags[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"]()') addToken xregexp.js:760:28

xregexp.js:2000:17 loadModuleImplementation require.js:320:6 guardedLoadModule require.js:214:36 metroRequire require.js:136:24 index.js:8:45 loadModuleImplementation require.js:320:6 guardedLoadModule require.js:214:36 metroRequire require.js:136:24 usernameValidator.js:2 loadModuleImplementation require.js:320:6 guardedLoadModule require.js:214:36 metroRequire require.js:136:24 ProfileHomeScreen.js:24 loadModuleImplementation require.js:320:6 guardedLoadModule require.js:214:36 metroRequire require.js:136:24 HomeStackNavigator.js:8 loadModuleImplementation require.js:320:6 guardedLoadModule require.js:214:36 metroRequire require.js:136:24 App.js:46 loadModuleImplementation require.js:320:6 guardedLoadModule require.js:214:36 metroRequire require.js:136:24 index.android.js:3 loadModuleImplementation require.js:320:6 guardedLoadModule require.js:207:45 metroRequire require.js:136:24 global code

With 3.2.0 everything works ok

ducaale commented 5 years ago

version 4.1.1 also works

josephfrazier commented 5 years ago

@slevithan, it looks like this might be due to the use of Symbol, which also caused problems in https://github.com/slevithan/xregexp/issues/254, and was fixed after version 4.2.0. Should we release version 4.2.1 and see if it helps?

slevithan commented 5 years ago

@josephfrazier, sounds good to me.

josephfrazier commented 5 years ago

Great, I'll put together the PR

lorenc-tomasz commented 5 years ago

4.2.2:

Unable to resolve module @babel/runtime/core-js/get-iterator from /Projects/xyz/node_modules/xregexp/lib/addons/unicode-base.js: Module @babel/runtime/core-js/get-iterator does not exist in the Haste module map

Runtime is installed as dependency :(

josephfrazier commented 5 years ago

See https://github.com/slevithan/xregexp/issues/262

slevithan commented 5 years ago

@lorenc-tomasz can you confirm whether this is resolved in v4.2.4?

lorenc-tomasz commented 5 years ago

@slevithan Bug resolved in 4.2.4. Thanks.