-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix invalid regular expression error #3795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@acoates-ms I updated the PR description with the problem. What do you think we should do? Wait a little bit to see if Metro is updated on React Native CLI 2.x? Wait until React Native for Windows gets updated to React Native 0.61.x? Or apply the patches of this PR and stop using the
The major problem is that if we initialize a project using react-native windows --template vnextit doesn't run unless we change |
|
The PR I submitted to bump Facebook Metro version on React Native CLI was not accepted. They said that is necessary to keep Metro in CLI and RN in sync and using Metro 0.56+ with RN 0.60 wouldn't work, although we could try to use yarn resolutions to overcome this. Given that, I think the best approach is just wait for React Native for Windows to be compatible with a newer version of React Native that does not contain this bug. |
|
I believe a combination of: |
Signed-off-by: Pedro Tôrres <t-pesant@microsoft.com>
Signed-off-by: Pedro Tôrres <t-pesant@microsoft.com>
Signed-off-by: Pedro Tôrres <t-pesant@microsoft.com>
Signed-off-by: Pedro Tôrres <t-pesant@microsoft.com>
Signed-off-by: Pedro Tôrres <t-pesant@microsoft.com>
|
Hey @acoates-ms, I've just tested the patches on I modified the other |
|
Dup of #4137 |
Facebook Metro has a bug facebook/metro#498 that replaces any
/with the system path separator on blacklist. So expressions like[/\\]become[\\\]on Windows and an invalid regular expression error in thrown when building some React Native for Windows projects.To really fix that we need:
This long path will occasionally happen, but it will take time. To fix this problem early on React Native for Windows, I propose a workaround that replaces expressions like
[/\\]with just/as Facebook Metro will already replace/with the correct path separator on each OS.Another problem is that the version of React Native CLI that we are using has a old version of Facebook Metro that uses
[/\\]expressions, so a local fix here would not help unless we stop using theblacklistfunction from Metro. To solve this problem I've submitted a PR to React Native CLI react-native-community/cli#893 back-porting the Facebook Metro update to React Native CLI 2.x.Microsoft Reviewers: Open in CodeFlow