Skip to content
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 Maximum call stack size exceeded error with circular reference #7288

Closed
tianjianchn opened this issue Apr 29, 2016 · 24 comments
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@tianjianchn
Copy link

Say, there are two files a.js and b.js.

a.js:

require('./b');

b.js:

require('./a')

After change one of this file, with Hot Reloading enabled, it will run into an infinite situation and cause Maximum call stack size exceeded finally.

Even if I use a dynamic require in a function, such as what in b.js:

function f(){
  require('./a')
}
@JohnyDays
Copy link
Contributor

Also having this issue

@satya164
Copy link
Contributor

satya164 commented Jul 4, 2016

cc @martinbigio

@madsleejensen
Copy link

madsleejensen commented Jul 20, 2016

Im having same issue! running react-native 0.29.2, it will only give the Maximum call stack size exceeded if "Remote JS debugging" is enabled. But without Remote JS debugging it will still import the modules 1000 of times making HOT extremely slow.

https://www.dropbox.com/s/qcwa3g3v5a5azi6/Screenshot%202016-07-20%2016.16.49.png?dl=0

@Rolando-Barbella
Copy link

Did anyone manage to solve this one, I'm having a hard time with this..

@respectTheCode
Copy link
Contributor

Adding module.hot.accept(() => { }); to one of the files in the circular reference fixes the error but excludes that file from hot reloading.

@ide
Copy link
Contributor

ide commented Sep 3, 2016

You could also try using JavaScript-style import and export instead of Node-style require. Might work, it's a lot more resilient to cycles.

@Rolando-Barbella
Copy link

Rolando-Barbella commented Sep 4, 2016

@respectTheCode Thanks, for now it does the job

@Rolando-Barbella
Copy link

@ide I'm using import and export, thanks anyway for the answer

@cllgeek
Copy link

cllgeek commented Nov 16, 2016

had anyone solve 'Im having same issue! running react-native 0.29.2, it will only give the Maximum call stack size exceeded if "Remote JS debugging" is enabled. But without Remote JS debugging it will still import the modules 1000 of times making HOT extremely slow.' problem??

@mschipperheyn
Copy link

+1 Dealing with this problem forever.

@tiagozc
Copy link

tiagozc commented Dec 8, 2016

As soon as I've created the project from CLI with init option, without even touch anything on the generated code, enabling JS debugging remotely cause this same maximum call stack size exceeded issue. Running through Android Emulator.

react-native-cli: 1.3.0
react-native: 0.39.1

@quinnliu
Copy link

same problem on "react-native": "0.38.0" and "react": "15.4.1" for iOS as soon as I try to Debug JS Remotely for debugging with Nucleotide code: https://github.com/Laybium/laybium/tree/issue-107

@dwilt
Copy link

dwilt commented Mar 8, 2017

For anyone have this problem, the workaround for me was using Xcode to deploy a simulator and not using react-native run-ios. When I use the cli, I get this error but when I used Xcode, I don't. Have no idea why the fuck it works that way but it does.

@codebymikey
Copy link

+1, on Android

1 similar comment
@webdevbyjoss
Copy link

+1, on Android

@hramos hramos added the Icebox label Aug 24, 2017
@hramos
Copy link
Contributor

hramos commented Aug 24, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos closed this as completed Aug 24, 2017
@DanielHoffmann
Copy link

This issue is still happening as of 0.48.0. This should be opened again

@mschipperheyn
Copy link

+1

@silentcloud
Copy link

same issue

@hramos
Copy link
Contributor

hramos commented Oct 27, 2017

I recommend opening a new issue and filling out the template (as recommended by the message above).

@realart
Copy link

realart commented Jan 31, 2018

Can't believe this is still not addressed!!!!

@rafeca
Copy link
Contributor

rafeca commented Feb 13, 2018

Hey folks! This has been recently fixed and it will be available in v0.54.0

@harrysolovay
Copy link

harrysolovay commented Apr 6, 2018

I'm running 0.54.4 and am still encountering this error. Here's the code that triggers the bug (I've logged out all values and the data structure is exactly what I want it to be... anything that strikes y'all as wrong syntactically?):

let onSlotPressesExist = false
if(slots.length == 2 && !!slots[1].length ) {
  slots = slots[1].map(slot => {
    if(!!slot.onPress) onSlotPressesExist = true
    return {
      ...slot,
      onPress : () => {
        if(!!slots[0].onPress) slots[0].onPress()
        if(!!slot.onPress) slot.onPress()
      },
      style : {
        ...slots[0].style,
        ...slot.style
      }
    }
  })
} else if(!!slots.length) {
  slots = slots.forEach(slot => {
    if(!!slot.onPress) onSlotPressesExist = true
  })
} else {
  console.warn('error with slots config')
}

@rafeca
Copy link
Contributor

rafeca commented Apr 10, 2018

@harrysolovay can you provide more information? do you have a circular dependency? Are you getting any error message in the device/console?

@facebook facebook locked as resolved and limited conversation to collaborators Aug 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests