loglevel-plugin-remote icon indicating copy to clipboard operation
loglevel-plugin-remote copied to clipboard

handle window undefined

Open webjay opened this issue 4 years ago • 4 comments

This will fix #28

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

webjay avatar Jul 03 '20 17:07 webjay

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

kutuluk avatar Jul 04 '20 10:07 kutuluk

@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

webjay avatar Jul 04 '20 14:07 webjay

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

ocni-dtu avatar Feb 27 '21 10:02 ocni-dtu

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?

matthewbordas avatar Sep 01 '21 18:09 matthewbordas