Skip to content

console doesn't work in web workers #411

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

Closed
japgolly opened this issue May 28, 2020 · 3 comments
Closed

console doesn't work in web workers #411

japgolly opened this issue May 28, 2020 · 3 comments

Comments

@japgolly
Copy link
Contributor

Using console from a web worker results in an exception:

Uncaught TypeError: Cannot read property 'console' of undefined"

Probably because window isn't defined. console does exist in the global scope (and also under self in that self.console exists).

@sjrd
Copy link
Member

sjrd commented May 28, 2020

Is there anything in this repo that works in a web worker?

@japgolly
Copy link
Contributor Author

That's a weird, very un-@sjrd response. Yeah man, there's a whole web worker package org.scalajs.dom.webworkers and it all works 😆 I expect the majority of the experiment package tree works.

@sjrd
Copy link
Member

sjrd commented May 28, 2020

OK, then I guess pull request welcome to make console an @JSGlobal instead of a field of window.

japgolly added a commit to japgolly/scala-js-dom that referenced this issue Jun 10, 2020
@sjrd sjrd closed this as completed in 1496242 Jun 10, 2020
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

2 participants