Web Worker compatibility
See original GitHub issueOver at jsdom, our web worker test fail if we update our dependencies. Here is the error that I got:
ReferenceError: window is not defined
at https://github.com/visionmedia/debug/blob/17d0e0bb49b46f53bd97aa6d7b56bf9990a8cb62/browser.js#L13
This line is missing a typeof window !== 'undefined'
check. This check is present in other locations in this file, so this issue looks like a small oversight.
After #378 is resolved, you might be interested in https://www.npmjs.com/package/karma-mocha-webworker @yamikuronue
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Web Workers | Can I use... Support tables for HTML5, CSS3, etc
Web Workers · Global · Chrome · Edge * · Safari · Firefox · Opera · IE · Chrome for Android.
Read more >Worker - Web APIs - MDN Web Docs
Chrome Edge
Worker Full support. Chrome4. Toggle history Full support. Edge...
Worker() constructor Full support. Chrome4. Toggle history Full support. Edge...
Support for ECMAScript modules Full...
Read more >Browser Compatibility Testing of Web Workers - LambdaTest
BROWSER SUPPORT FOR Web Workers · Google Chrome · Mozilla Firefox · Internet Explorer · Safari · Microsoft Edge · Opera.
Read more >Browser versions that support web workers? - Stack Overflow
Internet Explorer 10, Firefox, Chrome, Safari and Opera support Web workers. But it is a bit vague for me. It does not state...
Read more >The State Of Web Workers In 2021 - Smashing Magazine
Something that has only been explored at the surface is that Web Workers can also help your app consume less of your user's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Almost 😉, the issue still occurs on line 185:
This line should be
if (typeof window !== 'undefined') {
Alternatively, you could replace all instances of
window
withself
. This works within a worker, but also outside of a worker.I noticed that a lot of other modules pin
debug
to specific versions instead of using a version range, I end up with 13 different copies ofdebug
in jsdom. Luckily the only one that ends up in my browserify bundle is pinned at^2.0.0
.On it right now. Merry Christmas everyone!