Hot reloading breaks on iOS and Android with circular dependencies
See original GitHub issueIs 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
- Hot reloading reloads the UI in place and can resolve any issues with circular dependencies.
- The app does not crash.
Actual Behavior
- Hot reloading doesn’t work.
- For Android, the app will crash with a red screen:
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
- Enable hot reloading.
- Change the text in either “Dependency0.js” or “Dependency1.js”, the app should show the “Hot Reloading…” badge, but nothing will change.
- On iOS, the app will exit without a red screen. On android, the app should show a red screen with the warning “Maximum call stack exceeded” after a few seconds.
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:
git fetch
git checkout moreCircularDependencies
Similar bugs:
https://github.com/facebook/react-native/issues/16613 https://github.com/facebook/react-native/issues/7288
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
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 Can you check if this commit can be cherry picked in 0.54?