{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/6859","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/6859/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/6859/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/6859/events","html_url":"https://github.com/facebook/react-native/pull/6859","id":146559138,"number":6859,"title":"react app root path can be override by env var 'react_native_app_root'","user":{"login":"chrisliu529","id":1432819,"avatar_url":"https://avatars.githubusercontent.com/u/1432819?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisliu529","html_url":"https://github.com/chrisliu529","followers_url":"https://api.github.com/users/chrisliu529/followers","following_url":"https://api.github.com/users/chrisliu529/following{/other_user}","gists_url":"https://api.github.com/users/chrisliu529/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisliu529/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisliu529/subscriptions","organizations_url":"https://api.github.com/users/chrisliu529/orgs","repos_url":"https://api.github.com/users/chrisliu529/repos","events_url":"https://api.github.com/users/chrisliu529/events{/privacy}","received_events_url":"https://api.github.com/users/chrisliu529/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-07T09:25:01Z","updated_at":"2016-04-07T09:25:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/6859","html_url":"https://github.com/facebook/react-native/pull/6859","diff_url":"https://github.com/facebook/react-native/pull/6859.diff","patch_url":"https://github.com/facebook/react-native/pull/6859.patch"},"body":"This PR is to solve app build issue when node_modules is a symlink by providing an environmental variable to override the current *smart* guessing of app root path.\r\nI met this issue when I tried to setup a shared incremental node_modules directory to speed our react-native app build speed in CI. But the build crashed in step 'bundleReleaseJsAndAssets' with error messages like:\r\n> :app:bundleReleaseJsAndAssets\r\n> bundle: Created ReactPackager\r\n> uncaught error Error: NotFoundError: Cannot find entry file index.android.js in any of the roots:[\"/home/jenkins/shared_data\"]\r\n\r\nThe build is fixed by applying this patch and adding 'export react_native_app_root=${WORKSPACE}' before './gradlew assembleRelease' in build script.\r\n\r\n**Test plan**\r\n1. react-native init demo # init a demo app from scratch\r\n2. cd demo/android && ./gradlew assembleRelease # build works fine\r\n3. mkdir ~/shared_data && mv ../node_modules ~/shared_data && cd .. && ln -s ~/shared_data/node_modules . # create symlink for node_modules in shared data directory\r\n4.  cd demo/android && ./gradlew assembleRelease # build crashed with error message 'uncaught error Error: NotFoundError: Cannot find entry file index.android.js in any of the roots: [\"...\"]'\r\n5. apply this patch to ~/shared_data/node_modules/react-native/local-cli/default.config.js\r\n6. export react_native_app_root=${demo-app-path}\r\n7. rebuild and it works\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/206780206","html_url":"https://github.com/facebook/react-native/pull/6859#issuecomment-206780206","issue_url":"https://api.github.com/repos/facebook/react-native/issues/6859","id":206780206,"user":{"login":"facebook-github-bot","id":6422482,"avatar_url":"https://avatars.githubusercontent.com/u/6422482?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook-github-bot","html_url":"https://github.com/facebook-github-bot","followers_url":"https://api.github.com/users/facebook-github-bot/followers","following_url":"https://api.github.com/users/facebook-github-bot/following{/other_user}","gists_url":"https://api.github.com/users/facebook-github-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook-github-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook-github-bot/subscriptions","organizations_url":"https://api.github.com/users/facebook-github-bot/orgs","repos_url":"https://api.github.com/users/facebook-github-bot/repos","events_url":"https://api.github.com/users/facebook-github-bot/events{/privacy}","received_events_url":"https://api.github.com/users/facebook-github-bot/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T09:25:20Z","updated_at":"2016-04-07T09:25:20Z","body":"Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!"}}