question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning (workerize-loader): output.globalObject is set to "window". It should be set to "self" or "this" to support HMR in Workers

See original GitHub issue

Heya,

I’m trying to follow up your initial work in https://github.com/angular/angular-cli/pull/12575.

I see Warning (workerize-loader): output.globalObject is set to "window". It should be set to "self" or "this" to support HMR in Workers when serving, but not when building.

That warning seems to come from here: https://github.com/GoogleChromeLabs/worker-plugin/blob/cb00d315157412c405f9441bd7ff7662e6c16eb9/src/loader.js#L33

What’s the intended way of addressing this warning? I’d like to keep the globalObject settings of the main compilation unaltered.

As a side-note, the name workerize-loader is misleading. It took me a while to figure out that it came from this package since I was looking for a workerize-loader in node modules.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
filipesilvacommented, Feb 19, 2019

Hm yes, that would make sense. Regardless, thank you for the swift reply, will update 👍

1reaction
filipesilvacommented, Feb 19, 2019

There’s something I don’t quite understand though. If the child compiler already uses the right globalObject, why does it matter what globalObject the parent uses?

Read more comments on GitHub >

github_iconTop Results From Across the Web

worker-plugin - npm
WorkerPlugin will print a warning if your Webpack configuration has output.globalObject set to window , since doing so breaks Hot Module ...
Read more >
Why would webpack output with global `self` instead of `this ...
So I have created two valid webpack configs, one for server and one for client. Webpack outputs two separate files as specified, but...
Read more >
Web worker setup that (mostly) works - Quasar forum
It was important to me to have HMR working, and to be able to pass data back and forth between main thread and...
Read more >
Multithreading in JavaScript with Web Workers - LeanyLabs
JavaScript is single-threaded by default, and doing heavy calculations will make the application unresponsive. When it's taking too long, the browser will ......
Read more >
workerize-loader-webpack5 - npm package - Snyk
workerize -loader-webpack5. v1.3.1. Automatically move a module into a Web Worker (Webpack loader) For more information about how to use this ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found