react-native: Maximum call stack size exceeded when running react-native 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
- React Native version: 0.37 (would love to upgrade, I cannot because of #3406)
- Platform: not relevant
- Operating System: MacOS 10.12.2
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 8
- Comments: 18 (3 by maintainers)
@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).
Letting Xcode Update the project settings fixed the issue for me.
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
andnode_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.I used
git bisect
to find the commit, runningreact-native link
at each step. I restored theproject.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”.