tslog icon indicating copy to clipboard operation
tslog copied to clipboard

Bug: errors out when using react native with metro server

Open mat2718 opened this issue 3 years ago • 0 comments

Describe the bug errors out anytime it being run in react native app/ also had to manually install os and path.

To Reproduce Steps to reproduce the behavior:

  1. install tslog
  2. import Logger to a file like in the example given
  3. run React-native run android
  4. See error:
  5. WARN Require cycle: node_modules\os\index.js -> node_modules\os\index.js

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. ERROR TypeError: _$$_REQUIRE(dependencyMap[1], "os").hostname is not a function. (In '$$_REQUIRE(dependencyMap[1], "os").hostname()', '$$_REQUIRE(_dependencyMap[1], "os").hostname' is undefined) ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context running it within a react native app using a metro server

Node.js Version 16.x.x

OS incl. Version Windows 11

mat2718 avatar Nov 19 '21 02:11 mat2718