logdna / nodejs

Node.js library for logging to LogDNA
MIT License
74 stars 66 forks source link

Unable to resolve the 'utils' module with metro-bundle #89

Closed Katsuyu closed 4 years ago

Katsuyu commented 4 years ago

Hello,

I'm currently trying to change my log system from logz.io to logDNA on my react-native application.

After creating a Logger just like in the README.md of the repo, I try to log a simple message with a valid JSON as metadata. Screenshot from 2019-12-20 10-50-18

But when I launch my application with an emulator on android studio with metro-bundle, i'm getting an error saying that it can't find the 'utils' module used in lib/logger.js inside the node-modules

After searching a bit, I think that the missing 'utils' module is part of the basic node type library

Screenshot from 2019-12-20 10-41-05

Any idea of what may cause this ?

Katsuyu commented 4 years ago

After several tests, It seems that the library can't be used on a React-native app, maybe I'm doing something wrong ?

vilyapilya commented 4 years ago

@Katsuyu thank you for reaching out to us with your problem! We will work on making our service to be more suitable to use in react-native applications. Meanwhile, you can probably work around by installing util manually from this package https://www.npmjs.com/package/util as it is suggested here https://github.com/moment/luxon/issues/318. Thank you again for using LogDNA and we are looking forward to hearing from you!

darinspivey commented 4 years ago

@Katsuyu sorry this issue has been open for a while, so I wanted to follow up. Although this is a platform issue (with 'util' not existing), we may be able to address it by removing the debug logger which relies on util. I believe that's the only thing using it.

This code will be undergoing some "spring cleaning", so stay tuned for possible updates that fix your issue.

darinspivey commented 4 years ago

@Katsuyu our new client has been released, and it no longer has the utils module that was causing your issue. Please refer to the README in our new package, @logdna/logger

Feel free to open any issues under that new repository. Thanks!