{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/metro/issues/111","repository_url":"https://api.github.com/repos/facebook/metro","labels_url":"https://api.github.com/repos/facebook/metro/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/facebook/metro/issues/111/comments","events_url":"https://api.github.com/repos/facebook/metro/issues/111/events","html_url":"https://github.com/facebook/metro/issues/111","id":284972855,"number":111,"title":"Out of memory or out of time when compiling large JS files","user":{"login":"jeaye","id":1057635,"avatar_url":"https://avatars1.githubusercontent.com/u/1057635?v=4","gravatar_id":"","url":"https://api.github.com/users/jeaye","html_url":"https://github.com/jeaye","followers_url":"https://api.github.com/users/jeaye/followers","following_url":"https://api.github.com/users/jeaye/following{/other_user}","gists_url":"https://api.github.com/users/jeaye/gists{/gist_id}","starred_url":"https://api.github.com/users/jeaye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeaye/subscriptions","organizations_url":"https://api.github.com/users/jeaye/orgs","repos_url":"https://api.github.com/users/jeaye/repos","events_url":"https://api.github.com/users/jeaye/events{/privacy}","received_events_url":"https://api.github.com/users/jeaye/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2017-12-28T19:08:26Z","updated_at":"2018-04-20T03:32:24Z","closed_at":"2018-01-20T23:42:48Z","author_association":"NONE","body":"<!-- *Before creating an issue please make sure you are using the latest version of Metro, try re-installing your node_modules folder and run Metro once with `--reset-cache` to see if that fixes the problem you are experiencing.* -->\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\nBug.\r\n\r\n**What is the current behavior?**\r\nMetro will either run out of memory or it will give up after 5 minutes of waiting to transform the JS file.\r\n\r\nThis was first reported here https://github.com/facebook/react-native/issues/8475 and then again here https://github.com/facebook/react-native/issues/12590\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can `yarn install` and `yarn test`.**\r\nI have a repro repo here https://github.com/jeaye/react-native-packager-bug -- it's not in the `yarn` format, since I don't know what that is.\r\n\r\n**What is the expected behavior?**\r\nThe transformation completes in a timely fashion **or** metro waits long enough for the transformation to finish in however long it needs. In order to achieve the latter, my production build script currently contains the following:\r\n\r\n```bash\r\nmetro=../node_modules/metro-bundler/src/JSTransformer/index.js\r\nsed -i 's/\\(TRANSFORM_TIMEOUT_INTERVAL\\) = .*;/\\1 = 901000;/g' \"$metro\" || true\r\n```\r\n\r\n**Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.**\r\n\r\nReact Native: 0.50.4\r\nbabel-preset-react-native: 4.0.0\r\nMetro (comes with RN): 0.20.3\r\nNode: 9.3.0\r\nOS: Arch Linux x86_64\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/metro/issues/comments/382962291","html_url":"https://github.com/facebook/metro/issues/111#issuecomment-382962291","issue_url":"https://api.github.com/repos/facebook/metro/issues/111","id":382962291,"user":{"login":"jeaye","id":1057635,"avatar_url":"https://avatars1.githubusercontent.com/u/1057635?v=4","gravatar_id":"","url":"https://api.github.com/users/jeaye","html_url":"https://github.com/jeaye","followers_url":"https://api.github.com/users/jeaye/followers","following_url":"https://api.github.com/users/jeaye/following{/other_user}","gists_url":"https://api.github.com/users/jeaye/gists{/gist_id}","starred_url":"https://api.github.com/users/jeaye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeaye/subscriptions","organizations_url":"https://api.github.com/users/jeaye/orgs","repos_url":"https://api.github.com/users/jeaye/repos","events_url":"https://api.github.com/users/jeaye/events{/privacy}","received_events_url":"https://api.github.com/users/jeaye/received_events","type":"User","site_admin":false},"created_at":"2018-04-20T03:32:24Z","updated_at":"2018-04-20T03:32:24Z","author_association":"NONE","body":"@ChadHarrisVerr Nope, this is still very much an issue. metro doesn't handle large files well and has a non-linear time growth with respect to file size. So far, there's been no official way to speed things up and this ticket, just like many others here and in the react-native repo, has been closed with little help (read the full discussion here to understand more, if you haven't).\r\n\r\nI have documented my current workaround here: https://github.com/cljsrn/cljsrn-org/wiki/Avoiding-Metro-timeouts In short, I patch metro to not give up after several minutes of transforming and I just wait a long time for my prod builds. As a result of this, I also can't reasonably use something like jest for testing, since it wants a bundled package as well."}}
{"actor":{"display_login":"jeaye"}}