{"action":"opened","issue":{"url":"https://api.github.com/repos/facebook/fbjs/issues/58","labels_url":"https://api.github.com/repos/facebook/fbjs/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/facebook/fbjs/issues/58/comments","events_url":"https://api.github.com/repos/facebook/fbjs/issues/58/events","html_url":"https://github.com/facebook/fbjs/issues/58","id":107743011,"number":58,"title":"Inline requires throwing errors on existing node modules","user":{"login":"nsimmons","id":3313263,"avatar_url":"https://avatars.githubusercontent.com/u/3313263?v=3","gravatar_id":"","url":"https://api.github.com/users/nsimmons","html_url":"https://github.com/nsimmons","followers_url":"https://api.github.com/users/nsimmons/followers","following_url":"https://api.github.com/users/nsimmons/following{/other_user}","gists_url":"https://api.github.com/users/nsimmons/gists{/gist_id}","starred_url":"https://api.github.com/users/nsimmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsimmons/subscriptions","organizations_url":"https://api.github.com/users/nsimmons/orgs","repos_url":"https://api.github.com/users/nsimmons/repos","events_url":"https://api.github.com/users/nsimmons/events{/privacy}","received_events_url":"https://api.github.com/users/nsimmons/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-22T15:46:36Z","updated_at":"2015-09-22T15:46:36Z","closed_at":null,"body":"I noticed that the react-native CI has been failing recently. \r\n\r\nAn example CI failure: https://travis-ci.org/facebook/react-native/jobs/81593108\r\n\r\nIt's all related to \r\n```\r\nError: /Users/travis/build/facebook/react-native/node_modules/yeoman-generator/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js: Cannot assign to a require(...) alias, debug. Line: 53\r\n```\r\nSeems like this started happening after react-native started using `fbjs-scripts` here: https://github.com/facebook/react-native/commit/3fca7f4d7ba7a698c9831ac4ec6ad005be453bc0\r\n\r\nThis code is throwing the error: https://github.com/facebook/fbjs/blob/76faf46086f95141fe527eee567f8bc79b23a456/scripts/babel/inline-requires.js#L74-L91\r\n\r\nI located the source of the error being thrown and put up a PR for it here: \r\nhttps://github.com/nodejs/readable-stream/pull/161\r\n\r\nBut the question is, why do we want to throw an error here? There might be other node modules that do this kind of thing, and this error will show up every time this comes up. Fixing this error requires the source code to be fixed, the offending npm module to be published with the fix, and all npm modules that use it to get a version bump and also republished. \r\n\r\nSeems kind of painful to me. I don't understand the context of why we need to throw an error in this case though. \r\n\r\n@cpojer Could you provide some info here?\r\n"}}