node-bunyan
node-bunyan copied to clipboard
Fix error from undefined process.stderr
- Fix
Uncaught TypeError: Cannot read property 'write' of undefined
@alice-0-kim What environment are you running bunyan in which process.stderr
isn't defined? Is this in a browser, perhaps?
(FYI on the delay in my responding: https://github.com/trentm/node-bunyan/issues/335#issuecomment-648583828)
Instead of checking whether process.stderr
is defined, could you replace process.stderr.write(msg + '\n')
with console.error(msg)
? That should work in a browser as well as Node.js without special handling.