infinitered / ignite

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more!
MIT License
17.44k stars 1.38k forks source link

Command failed: react-native link rnpm-install ERR! Something went wrong while linking. Error: Maximum call stack size exceeded #1345

Closed zuijiaoluo closed 5 years ago

zuijiaoluo commented 5 years ago

What's going on? link error

Steps to reproduce ignite new xxxx

ignite doctor results: System platform darwin
arch x64
cpu 4 cores Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
directory /Users/xxxx

JavaScript node 8.9.1 /Users/xxxx/.nvm/versions/node/v8.9.1/bin/node
npm 5.6.0 /Users/xxxx/.nvm/versions/node/v8.9.1/bin/npm
yarn 1.12.3 /Users/xxxx/.nvm/versions/node/v8.9.1/bin/yarn

React Native react-native-cli 2.0.1

Ignite ignite 2.1.2 /Users/xxxx/.nvm/versions/node/v8.9.1/bin/ignite

Android java 1.8.0_101 /usr/bin/java
android home - /Users/xxxx/Library/Android/sdk

iOS xcode 10.1

error message: an error occured while installing ignite-ir-boilerplate-bowser boilerplate. Error: Command failed: react-native link 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

RangeError: Maximum call stack size exceeded at merge_obj (/Users/xxxx/node_modules/xcode/lib/parser/pbxproj.js:1883:25) at merge_obj (/Users/xxxx/node_modules/xcode/lib/parser/pbxproj.js:1888:24) at merge_obj (/Users/xxxx/node_modules/xcode/lib/parser/pbxproj.js:1888:24) at merge_obj (/Users/xxxx/node_modules/xcode/lib/parser/pbxproj.js:1888:24) at merge_obj (/Users/xxxx/node_modules/xcode/lib/parser/pbxproj.js:1888:24) at merge_obj (/Users/xxxx/node_modules/xcode/lib/parser/pbxproj.js:1888:24) at merge_obj (/Users/xxxx/node_modules/xcode/lib/parser/pbxproj.js:1888:24) at merge_obj (/Users/xxxx/node_modules/xcode/lib/parser/pbxproj.js:1888:24) at merge_obj (/Users/xxxx/node_modules/xcode/lib/parser/pbxproj.js:1888:24) at merge_obj (/Users/xxxx/node_modules/xcode/lib/parser/pbxproj.js:1888:24)

jamonholmgren commented 5 years ago

@zuijiaoluo Thanks for reporting, this issue was introduced recently; we will get on this.

morgandonze commented 5 years ago

This error was probably caused by ignite-ir-boilerplate-bowser

I ran git bisect on Bowser, starting with commit 3f4f9c4 (in Bowser)

The result showed the first bad commit as f01a5c3:

f01a5c3716ca944a5de4abf0aacf48f23ed45d49 is the first bad commit
commit f01a5c3716ca944a5de4abf0aacf48f23ed45d49
Author: Jamon Holmgren <jamon@infinite.red>
Date:   Wed Nov 14 12:53:12 2018 -0800

    Upgraded React Native to version 0.57.5, fixed `new` errors

:100644 100644 e52382ba7426f328925d82a03f649486defbf839 e80ef88f240b496e5406e0ba75b8f84a447edacf M      boilerplate.js
:040000 040000 908268cafd151f95d34d795ce7aed8f1afa97018 333f9dcb1a0008fc602bd07fd5704db6e669c32c M      boilerplate
:040000 040000 2c2646de709d479eaf4dcfabd5d0b96ab4497d17 d5e38dbd501c5d8e289ee5bff9e920943f16f412 M      lib
morgandonze commented 5 years ago

This error occurs when Bowser runs react-native link (in its boilerplate.js)

When opening a project in XCode, items appear in a group in the project explorer called "Recovered References". For each of these items, correpsonding entires are added to project.pbxproj.

After this is done, react-native link will work without this error.

I mistakenly thought that react-native link was the cause of the changes in project.pbxproj. Those changes are made BY XCODE upon opening the project!

So this issue could be fixed by programatically doing whatever XCode does, immediately before running react-native link

❓ But how does XCode do this?

bryanstearns commented 5 years ago

I dug into this a bit, without resolution; here's as far as I got:

I'm guessing that this isn't a problem with the merge_obj function - I think whatever modified the pbxproj file corrupted it. Further, since it mentions splash screens, I suspect that one of the splash screen patches is doing it, but haven't had a chance to dig further.

zuijiaoluo commented 5 years ago

Is there any new progress?

nirre7 commented 5 years ago

Might be the splash-screen.patch that's the culprit. I had many issues with it when upgrading the bowser boilerplate previously.

jamonholmgren commented 5 years ago

We have a potential fix up in https://github.com/infinitered/ignite-ir-boilerplate-bowser/pull/127, just need to fix the CI and we'll get a new version up. @zuijiaoluo @nirre7

morgandonze commented 5 years ago

Closing since https://github.com/infinitered/ignite-bowser/pull/127 is merged. Please open new issue if necessary.