kutuluk / loglevel-plugin-remote

A loglevel plugin for sending browser logs to a server
MIT License
102 stars 36 forks source link

handle window undefined #29

Open webjay opened 4 years ago

webjay commented 4 years ago

This will fix #28

I have tested that GatsbyJS can now build when using import remote from 'loglevel-plugin-remote';

kutuluk commented 4 years ago

then the error will be here https://github.com/kutuluk/loglevel-plugin-remote/blob/master/src/remote.js#L277

webjay commented 4 years ago

@kutuluk no, as the code will not be run in Node, only packed in Node. The browser will run it. The only reason why it can't be packed now is caused by: https://github.com/kutuluk/loglevel-plugin-remote/blob/master/src/remote.js#L1

pimterry/loglevel can handle builds: https://github.com/pimterry/loglevel/issues/146#issuecomment-649636262

ocni-dtu commented 3 years ago

I'm facing the same error/bug when using Gatsby Is it possible to merge the PR that fixes this?

matthewbordas commented 3 years ago

It's a bummer that this doesn't work in Node seeing as how loglevel does. Is there an intention to add that support in the future?