{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/23943","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/23943/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/23943/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/23943/events","html_url":"https://github.com/facebook/react-native/issues/23943","id":421366727,"node_id":"MDU6SXNzdWU0MjEzNjY3Mjc=","number":23943,"title":"Cannot find module 'warnOnce' from 'react-native-implementation.js'","user":{"login":"flodev","id":1429063,"node_id":"MDQ6VXNlcjE0MjkwNjM=","avatar_url":"https://avatars1.githubusercontent.com/u/1429063?v=4","gravatar_id":"","url":"https://api.github.com/users/flodev","html_url":"https://github.com/flodev","followers_url":"https://api.github.com/users/flodev/followers","following_url":"https://api.github.com/users/flodev/following{/other_user}","gists_url":"https://api.github.com/users/flodev/gists{/gist_id}","starred_url":"https://api.github.com/users/flodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flodev/subscriptions","organizations_url":"https://api.github.com/users/flodev/orgs","repos_url":"https://api.github.com/users/flodev/repos","events_url":"https://api.github.com/users/flodev/events{/privacy}","received_events_url":"https://api.github.com/users/flodev/received_events","type":"User","site_admin":false},"labels":[{"id":1304117544,"node_id":"MDU6TGFiZWwxMzA0MTE3NTQ0","url":"https://api.github.com/repos/facebook/react-native/labels/Bug","name":"Bug","color":"ffffff","default":false},{"id":542043367,"node_id":"MDU6TGFiZWw1NDIwNDMzNjc=","url":"https://api.github.com/repos/facebook/react-native/labels/Issue:%20Author%20Provided%20Repro","name":"Issue: Author Provided Repro","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":49,"created_at":"2019-03-15T06:04:17Z","updated_at":"2019-08-08T05:50:00Z","closed_at":"2019-06-21T12:15:25Z","author_association":"NONE","body":"## 🐛 Bug Report\r\nWhen requiring react-native in node context (e.g. jest) module warnOnce cannot be found.\r\n  ● Test suite failed to run\r\n\r\n    Cannot find module 'warnOnce' from 'react-native-implementation.js'\r\n\r\n## To Reproduce\r\nTestFile.js\r\n```\r\nimport { PixelRatio } from 'react-native'\r\n\r\nexport default class TestFile {\r\n}\r\n```\r\n\r\nTestFile.test.js\r\n```\r\nimport TestFile from './TestFile'\r\n\r\ntest('test', () => {\r\n  ...\r\n})\r\n```\r\n\r\n## Expected Behavior\r\nwarnOnce should be found and loaded just like invariant.\r\n\r\n\r\n## Workaround\r\n\r\nAs a workaround I'm mocking react-native dependency with `jest.doMock('react-native', () => reactNativeMock))`\r\n## Environment\r\n```\r\ninfo\r\n  React Native Environment Info:\r\n    System:\r\n      OS: macOS 10.14.3\r\n      CPU: (8) x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz\r\n      Memory: 3.06 GB / 16.00 GB\r\n      Shell: 3.2.57 - /bin/bash\r\n    Binaries:\r\n      Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node\r\n      Yarn: 1.13.0 - ~/.nvm/versions/node/v8.10.0/bin/yarn\r\n      npm: 6.8.0 - ~/.nvm/versions/node/v8.10.0/bin/npm\r\n      Watchman: 4.9.0 - /usr/local/bin/watchman\r\n    SDKs:\r\n      iOS SDK:\r\n        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1\r\n      Android SDK:\r\n        API Levels: 23, 25, 26, 27, 28\r\n        Build Tools: 21.1.2, 23.0.1, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3\r\n        System Images: android-19 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom\r\n    IDEs:\r\n      Android Studio: 3.3 AI-182.5107.16.33.5199772\r\n      Xcode: 10.1/10B61 - /usr/bin/xcodebuild\r\n    npmPackages:\r\n      react: 16.8.3 => 16.8.3\r\n      react-native: 0.59.1 => 0.59.0\r\n    npmGlobalPackages:\r\n      create-react-native-app: 2.0.2\r\n      react-native-cli: 2.0.1\r\n      react-native-git-upgrade: 0.2.7\r\n      react-native-rename: 2.4.0\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/519375041","html_url":"https://github.com/facebook/react-native/issues/23943#issuecomment-519375041","issue_url":"https://api.github.com/repos/facebook/react-native/issues/23943","id":519375041,"node_id":"MDEyOklzc3VlQ29tbWVudDUxOTM3NTA0MQ==","user":{"login":"AbhishekNairOfficial","id":30291517,"node_id":"MDQ6VXNlcjMwMjkxNTE3","avatar_url":"https://avatars2.githubusercontent.com/u/30291517?v=4","gravatar_id":"","url":"https://api.github.com/users/AbhishekNairOfficial","html_url":"https://github.com/AbhishekNairOfficial","followers_url":"https://api.github.com/users/AbhishekNairOfficial/followers","following_url":"https://api.github.com/users/AbhishekNairOfficial/following{/other_user}","gists_url":"https://api.github.com/users/AbhishekNairOfficial/gists{/gist_id}","starred_url":"https://api.github.com/users/AbhishekNairOfficial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbhishekNairOfficial/subscriptions","organizations_url":"https://api.github.com/users/AbhishekNairOfficial/orgs","repos_url":"https://api.github.com/users/AbhishekNairOfficial/repos","events_url":"https://api.github.com/users/AbhishekNairOfficial/events{/privacy}","received_events_url":"https://api.github.com/users/AbhishekNairOfficial/received_events","type":"User","site_admin":false},"created_at":"2019-08-08T05:50:00Z","updated_at":"2019-08-08T05:50:00Z","author_association":"NONE","body":"Still have this issue with the above steps:\r\n\r\n- OS: macOS Mojave 10.14.6\r\n- react: 16.8.6\r\n- react-native: 0.60.4\r\n- Jest: 24.8.0\r\n\r\nI'm hoping RN v0.61 will come out soon."}}
{"actor":{"display_login":"AbhishekNairOfficial"}}