-
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
Hot reloading breaks on iOS and Android with circular dependencies #17969
Comments
This is fixed on RN master since updating to metro 0.26.0: Hopefully it can get patched into 0.54 |
@grabbou Can you check if this commit can be cherry picked in 0.54? |
Yup, see no reason not to update the dependency. I'll wait with the release for a couple of days to make sure I cherry pick everything remaining. |
@grabbou will this end up making it into 0.54? |
Yup, we've bumped Metro already in latest RC. I think it can be closed in that case. |
In general, circular dependencies should be avoided. Checkout madge for dependency analysis, also pointing out circular dependencies. |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 6.10.3
Yarn: Not Found
npm: 3.10.10
Watchman: Not Found
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.53.0 => 0.53.0
Steps to Reproduce
Creating a simple circular dependency chain will cause hot reloading to no longer work, and eventually the app will crash with "Maximum call stack size exceeded." This happens on both iOS and Android.
Expected Behavior
Actual Behavior
For iOS, the app will exit without a red screen:
https://drive.google.com/open?id=1BWmmp2yPqtL9zmx4yYQ-yRyrg7nioDhB
Reproducible Demo
Repro steps (feel free to do react-native run-ios as well):
git clone https://github.com/dannycochran/react-native-hot-reloading cd react-native-hot-reloading react-native run-android
If the app is not crashing, check out the branch with more circular dependencies and repeat the steps above. It almost always crashes for me with the use case on master (which I tried to make as simple as possible), but this branch is a little more complex in terms of the dependency tree, but always fails:
Similar bugs:
#16613
#7288
The text was updated successfully, but these errors were encountered: