{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/metro-bundler/issues/65","repository_url":"https://api.github.com/repos/facebook/metro-bundler","labels_url":"https://api.github.com/repos/facebook/metro-bundler/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/facebook/metro-bundler/issues/65/comments","events_url":"https://api.github.com/repos/facebook/metro-bundler/issues/65/events","html_url":"https://github.com/facebook/metro-bundler/issues/65","id":261176023,"number":65,"title":"Getting \"require() must have a single string literal argument\" when bundling moment.js","user":{"login":"TikiTDO","id":326184,"avatar_url":"https://avatars0.githubusercontent.com/u/326184?v=4","gravatar_id":"","url":"https://api.github.com/users/TikiTDO","html_url":"https://github.com/TikiTDO","followers_url":"https://api.github.com/users/TikiTDO/followers","following_url":"https://api.github.com/users/TikiTDO/following{/other_user}","gists_url":"https://api.github.com/users/TikiTDO/gists{/gist_id}","starred_url":"https://api.github.com/users/TikiTDO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TikiTDO/subscriptions","organizations_url":"https://api.github.com/users/TikiTDO/orgs","repos_url":"https://api.github.com/users/TikiTDO/repos","events_url":"https://api.github.com/users/TikiTDO/events{/privacy}","received_events_url":"https://api.github.com/users/TikiTDO/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":70,"created_at":"2017-09-28T02:40:49Z","updated_at":"2017-10-10T15:19:57Z","closed_at":"2017-10-09T09:50:24Z","author_association":"NONE","body":"<!-- *Before creating an issue please make sure you are using the latest version of metro-bundler, try re-installing your node_modules folder and run metro-bundler 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\n\r\nBug\r\n\r\n**What is the current behavior?**\r\n\r\nWhen attempting to package a project which makes use of the https://github.com/moment/moment.js library, the packager crashes with the error `require() must have a single string literal argument`\r\n\r\nThe library line in question is: https://github.com/moment/moment/blob/develop/moment.js#L1830 which appears to be perfectly javascript code.\r\n\r\nThis behavior does not seem to happen when I build the bundle with RN 0.48.4, however that particular build has issues when running on an phone running Oreo.\r\n\r\nI can work around this issue by disabling the error in question by adding a `return` statement before this line: https://github.com/facebook/metro-bundler/blob/master/packages/metro-bundler/src/JSTransformer/worker/extract-dependencies.js#L39\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\n\r\nI am working on a repo to reproduce this behavior,  however my time is limited due to pressing issues that need to be addressed within the next week so I have not been able to get a proper minimalist reproduction of this behavior.\r\n\r\nI will update this issue with a link once I can get a good example.\r\n\r\n**What is the expected behavior?**\r\n\r\nThere should not be any errors when packaging the JS bundle with the above library\r\n\r\n**Please provide your exact metro-bundler configuration and mention your metro-bundler, node, yarn/npm version and operating system.**\r\n\r\nRN: 0.49.0-rc.5\r\nmetro-bundler: 0.13.0\r\nOS: Arch Linux\r\nMobile OS: Android 8.0.0\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/metro-bundler/issues/comments/335508614","html_url":"https://github.com/facebook/metro-bundler/issues/65#issuecomment-335508614","issue_url":"https://api.github.com/repos/facebook/metro-bundler/issues/65","id":335508614,"user":{"login":"rcorrie","id":6488063,"avatar_url":"https://avatars2.githubusercontent.com/u/6488063?v=4","gravatar_id":"","url":"https://api.github.com/users/rcorrie","html_url":"https://github.com/rcorrie","followers_url":"https://api.github.com/users/rcorrie/followers","following_url":"https://api.github.com/users/rcorrie/following{/other_user}","gists_url":"https://api.github.com/users/rcorrie/gists{/gist_id}","starred_url":"https://api.github.com/users/rcorrie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcorrie/subscriptions","organizations_url":"https://api.github.com/users/rcorrie/orgs","repos_url":"https://api.github.com/users/rcorrie/repos","events_url":"https://api.github.com/users/rcorrie/events{/privacy}","received_events_url":"https://api.github.com/users/rcorrie/received_events","type":"User","site_admin":false},"created_at":"2017-10-10T15:19:57Z","updated_at":"2017-10-10T15:19:57Z","author_association":"NONE","body":"@richardgirges thanks but I still get the same error "}}
{"actor":{"display_login":"rcorrie"}}