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 issueHeya,
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:
- Created 5 years ago
- Comments:5
Top 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 >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 FreeTop 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
Top GitHub Comments
Hm yes, that would make sense. Regardless, thank you for the swift reply, will update 👍
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?