You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to use caterpillar logger in an frontend app ( using vite, react etc ) on browser
Getting error in the console and unable to proceed further
> Logger Instantiation Code
import{Logger,Human,Browser}from'caterpillar';// Caterpillar loggerconstcLogger=newLogger();cLogger.pipe(newHuman()).pipe(newBrowser());cLogger.log('warn','this is a warning, which is level',4);cLogger.warn('this is a warning, which is level',4);
> Error On Console
browser-external:util:9Module"util"hasbeenexternalizedforbrowsercompatibility.Cannotaccess"util.inspect"inclientcode.See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.get @ browser-external:util:9human.js:72Uncaught(inpromise) TypeError: (0,import_util.inspect)isnotafunctionathuman.js:72:15atArray.map(<anonymous>)
at Human.formatArguments (human.js:70:14)
at Human.format (human.js:105:24)
at Human.write (transform.js:28:27)
at transform.js:38:32
Hrmmm, seems inspect needs to be removed from the human browser bundle, or internalised within it. Thanks for the detailed log. Not sure when I will get to this, could be a few months from now. If it's important for your company, the work can be funded to make it a priority.
Issue :
> Logger Instantiation Code
> Error On Console
> Package.json File Contents
The text was updated successfully, but these errors were encountered: