scala-js/scala-js-dom

console doesn't work in web workers

japgolly opened this issue · 3 comments

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 commented

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

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 commented

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