-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
react-native-community-cli in 0.61+ breaks existing working builds #28768
Comments
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
This issue still requires attention. It is not resolved. The above inclusion is ok, however the CLI's code does not understand that Without node_modules directory being found, the cli.js code fails. It is not clear to me whether the CLI community team feels that the previously working functionality in this area could be broken, or they feel that they have fixed it. They stopped replying to previously referenced bug report. |
Hello, |
Hi @vladp thanks for the issue and sorry that you have problems. This would be more appropriate filing with the CLI team. React Native core will have CLI as a dependency. If you want to propose a new implementation, you can do so here https://github.com/react-native-community/discussions-and-proposals |
Closing, but please create an issue with CLI to get this resolved |
@safaiyeh I had created this issue with CLI, october 2019. Since RN had adapted CLI as the only method of building apps, and the CLI broke previously available functionality -- I am asking the RN team to look into this. |
I would second that request. I was counting on a resolution here to accommodate our project structure. Without a fix, I haven't been able to upgrade RN in months while the iOS branch drifts further and further away. |
Description
RN 0.60+ made usage of @react-native-community/cli required (at least for Android).
in 0.61 @react-native-community/cli broke application builds that do not comply with their new relative-directory structure requirement (which is also not well documented)
This a regression of capabilities offered by previous releases of RN.
If one has:
This directory structure no longer works with 0.61+ React native releases.
The new CLI tool ignores react-native Android project template documentation,
when it comes to specifying the directory 'where package.json lives':
https://github.com/facebook/react-native/blob/master/template/android/app/build.gradle
And, instead, @react-native-community/cli tries to infer where package.json lives by using nodeJS module resolution guessing (which is done simply by invoking node in the directory root project direction of Android app, and having nodeJS to search for node_modules .. .which it cannot find, in the above described case).
The issue was reported in October 2019.
react-native-community/cli#804
Now it is marked as closed, but the issue is not fixed (and is not re-opened).
There is no way to disable autolinking feature in the new CLI (which is where the regression was introduced), so no way to workaround this regression.
React Native version:
Please note, the issue first appeared in RN 0.60, reported but not fixed since October 2019.
So this bug report requests that RN makes necessary changes to make @react-native-community/cli optional.
[v@host rn.common]$ ./node_modules/.bin/react-native info
info Fetching system and libraries information...
System:
OS: Linux 5.5 Fedora 31 (Thirty One) 31 (Thirty One)
CPU: (4) x64 Intel(R) Core(TM) i7 CPU
Memory: 511.33 MB / 11.51 GB
Shell: 5.0.11 - /bin/bash
Binaries:
Node: 12.16.1 - /bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.4 - /bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: javac 14 - /bin/javac
Python: 3.7.6 - /bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: ^0.62 => 0.62.2
npmGlobalPackages:
react-native: Not Found
[v@host rn.common]$
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Setup an android project such as
Expected Results
see the detailed example, with this regression -- the build on Android fails
react-native-community/cli#804
The text was updated successfully, but these errors were encountered: