Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use in worker because window is not defined #64

Open
bmatcuk opened this issue Jan 23, 2023 · 3 comments
Open

Cannot use in worker because window is not defined #64

bmatcuk opened this issue Jan 23, 2023 · 3 comments

Comments

@bmatcuk
Copy link

bmatcuk commented Jan 23, 2023

In src/utils.ts, the console methods are cached. However, in a JS worker, window is undefined, and, so, this code fails with "ReferenceError: window is not defined".

It appears these cached methods are only used in two places: src/plugins/logger.ts and src/capture.ts.

@bmatcuk
Copy link
Author

bmatcuk commented Jan 23, 2023

I opened a PR to fix the issue: #65

@asashay
Copy link

asashay commented Feb 1, 2023

That would be really nice to have! I am not able to use the library in the Web Extension's background script because of this

@maxfliri
Copy link

+1.

I have the same problem, and at the moment I'm unable to use this library in my client-side code. I'm using @logdna/logger instead, but that also has some problems because it's written for node and not for the browser.

When can we expect a fix for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants