question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hot reloading breaks on iOS and Android with circular dependencies

See original GitHub issue

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

  1. Hot reloading reloads the UI in place and can resolve any issues with circular dependencies.
  2. The app does not crash.

Actual Behavior

  1. Hot reloading doesn’t work.
  2. For Android, the app will crash with a red screen:
screen shot 2018-02-13 at 10 23 11 am

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
  1. Enable hot reloading.
  2. Change the text in either “Dependency0.js” or “Dependency1.js”, the app should show the “Hot Reloading…” badge, but nothing will change.
  3. 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:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
grabboucommented, Feb 21, 2018

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.

1reaction
K-Leoncommented, Feb 20, 2018

@grabbou Can you check if this commit can be cherry picked in 0.54?

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Hilt circular dependency - Stack Overflow
The cyclic dependency is there, but without seeing the code of the implementations for AccessTokenAuthenticator and ...
Read more >
How bad is for usability to allow circular module dependencies?
It could be bad for usability not to allow circular dependencies. If you try to organize the ideas expressed in your language and...
Read more >
Circular Dependencies - StealJS
Circular dependencies refers to the uncommon, but some times necessary, practice of having two (or more) modules that depend on each other.
Read more >
Visual Studio 2022 for Mac v17.4 Release Notes
Fixed Hot Reloading of XAML changes to iOS devices during a debug session. We added support for MAUI archiving and publishing. We improved...
Read more >
cljsrn 2021-06-23 | Slack Archive
... a few seconds after hot reload (shadow-cljs) on android, but not on ios. ... shadow-cljs won't compile circular dependencies. you'll get an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found