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

Maximum call stack size exceeded when running react-native link #12188

Closed
aymericbouzy opened this issue Feb 3, 2017 · 18 comments
Closed

Maximum call stack size exceeded when running react-native link #12188

aymericbouzy opened this issue Feb 3, 2017 · 18 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@aymericbouzy
Copy link

Description

What I did : I ran react-native link
I expected the command to succeed, here was the output :

rnpm-install ERR! It seems something went wrong while linking. Error: Maximum call stack size exceeded 
Please file an issue here: https://github.com/facebook/react-native/issues 

Maximum call stack size exceeded

Reproduction

Haven't been able to reproduce yet (I can reproduce fine with my current repo, I just cannot create a broken project from a new project).

Solution

I've no idea.

Additional Information

@aymericbouzy
Copy link
Author

When running react-native link react-native-material-kit I get :

rnpm-install info Android module react-native-material-kit is already linked 
rnpm-install ERR! It seems something went wrong while linking. Error: Maximum call stack size exceeded 
Please file an issue here: https://github.com/facebook/react-native/issues 

Maximum call stack size exceeded

Same with any other package.
It makes me think the issue is with the iOS Platform.

@aymericbouzy
Copy link
Author

The culprit is the 'xcode' package. It fails parsing my project at line 10 of file local-cli/link/ios/isInstalled.js.

Adding a better error message would be nice.

Here is the stacktrace :

RangeError: Maximum call stack size exceeded
    at RegExp.test (native)
    at peg$parseIdentifier (/Users/aymericbouzy/Documents/Développement informatique/instant_job_app/node_modules/xcode/lib/parser/pbxproj.js:1216:19)
    at peg$parseCommentedIdentifier (/Users/aymericbouzy/Documents/Développement informatique/instant_job_app/node_modules/xcode/lib/parser/pbxproj.js:724:12)
    at peg$parseCommentedAssignment (/Users/aymericbouzy/Documents/Développement informatique/instant_job_app/node_modules/xcode/lib/parser/pbxproj.js:611:12)
    at peg$parseAssignment (/Users/aymericbouzy/Documents/Développement informatique/instant_job_app/node_modules/xcode/lib/parser/pbxproj.js:542:14)
    at peg$parseAssignmentList (/Users/aymericbouzy/Documents/Développement informatique/instant_job_app/node_modules/xcode/lib/parser/pbxproj.js:462:14)
    at peg$parseAssignmentList (/Users/aymericbouzy/Documents/Développement informatique/instant_job_app/node_modules/xcode/lib/parser/pbxproj.js:467:18)
    at peg$parseAssignmentList (/Users/aymericbouzy/Documents/Développement informatique/instant_job_app/node_modules/xcode/lib/parser/pbxproj.js:467:18)
    at peg$parseAssignmentList (/Users/aymericbouzy/Documents/Développement informatique/instant_job_app/node_modules/xcode/lib/parser/pbxproj.js:467:18)
    at peg$parseAssignmentList (/Users/aymericbouzy/Documents/Développement informatique/instant_job_app/node_modules/xcode/lib/parser/pbxproj.js:467:18) 

@dxiao
Copy link

dxiao commented Feb 4, 2017

Just ran into this issue as well. How did you figure out the callstack?

@juddey
Copy link
Contributor

juddey commented Feb 4, 2017

I've got this one as well

React Native 0.40.0, OSX 10.12.3.

@aymericbouzy
Copy link
Author

I went in the file and logged the error's stack ;)

@dxiao
Copy link

dxiao commented Feb 9, 2017

In case anybody else runs into this kind of error, ended up being my own fault. Creative insertion of console.log()'s into node_modules/react-native/local-cli/link/ios/isInstalled.js and node_modules/xcode/lib/parser/pbxproj.js showed me the issue. It turns out I had recently upgraded react-native, and while fixing merge conflicts from react-native-git-upgrade had introduced a duplicated entry into my project.pbxproj file. Once I cleared that up, everything worked fine.

@aymericbouzy
Copy link
Author

Thanks! Any tip on finding the duplicated entry? I'm considering going through my git history to find the breaking commit and then inspect it, but maybe you have a more efficient way of doing this?

@aymericbouzy
Copy link
Author

I used git bisect to find the commit, running react-native link at each step.
I restored the project.pbxproj to the way it was on the latest "good" commit. Indeed, I had broken the file when I had tried upgrading.
From there, I restored the project to its current state (I had not done much change to the Xcode project luckily), and everything works fine ! thanks @dxiao.

It would be nice to have file parser that helps with upgrading the Xcode project when upgrading React Native, that would at least tell if the project.pbxproj "looks fine".

@juddey
Copy link
Contributor

juddey commented Feb 10, 2017

I had duplicates in my .pbxproj too. Once I removed those and re-ran, all was fine.

@sathyakumarseshachalam
Copy link

I have removed the duplicates in my .pbxproj via xUnique. Yet I keep getting the below error

rnpm-install info Android module react-native-fbsdk is already linked
rnpm-install ERR! It seems something went wrong while linking. Error: Maximum call stack size exceeded
Please file an issue here: https://github.com/facebook/react-native/issues

And almost sure .pbxproj is at fault here, for a couple commits back, this works without any problem, but just not able to pinpoint the problem.

PS : I come from a non-ios/xcode background

@sathyakumarseshachalam
Copy link

My bad. Had duplicate image assets. Removing them and re-running helped.

@cdesch
Copy link

cdesch commented Mar 16, 2017

Letting Xcode Update the project settings fixed the issue for me.

@jamesone
Copy link

jamesone commented May 24, 2017

@cdesch Can confirm that this fixed it for me! For anyone wanting to know where you can update to the recommended settings: open xcode => the left sidebar should give you the option to update the recommended settings (it should have a yellow warning symbol next to it).

@hramos
Copy link
Contributor

hramos commented Jul 26, 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 added the Icebox label Jul 26, 2017
@hramos hramos closed this as completed Jul 26, 2017
@atitpatel
Copy link

Facing the same issue for lottie-react-native while linking. I am doing it for android. Any help is appreciated.

@Build100
Copy link

Opened the old project for Android. I see the same error. Fixed in package.json
"react": "16.0.0",
"react-native": "0.49.0",
App working.

@jaxatto
Copy link

jaxatto commented Jun 28, 2018

SOLVED: Keeping this here if anyone else has the same issue.

Having the same issue for react-native link react-native-svg. @cdesch / @jamesone's solution didn't work for me for this issue, though it did for a different maximum stack issue?


rnpm-install info Linking react-native-svg android dependency 
rnpm-install info Android module react-native-svg has been successfully linked 
rnpm-install ERR! Something went wrong while linking. Error: Maximum call stack size exceeded 
Please file an issue here: https://github.com/facebook/react-native/issues 

Maximum call stack size exceeded

Solution:

From linked above, this:
infinitered/ignite-bowser#42 (comment)

Deleting "Recovered References: in xcode fixes the problem for me.

@solaomosola
Copy link

Same issue, was able to fix it by deleting libRNFetchBlob.a from Recovered References. Works fine now.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 26, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 26, 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