Webpack warning of circular dependencies inside workerHelper.js
See original GitHub issueWARNING in [entry] [initial]
Circular dependency between chunks with runtime (main, pkg_snippets_wasm-bindgen-rayon-7afa899f36665473_src_workerHelpers_js, src_worker_js-pkg_snippets_wasm-bindgen-rayon-7afa899f36665473_src_workerHelpers_js)
This prevents using hashes of each other and should be avoided.
Current versions of webpack don’t seem to like the recursion inside workerHelper.js
// Self-spawn into a new Worker.
//
// TODO: while `new URL('...', import.meta.url) becomes a semi-standard
// way to get asset URLs relative to the module across various bundlers
// and browser, ideally we should switch to `import.meta.resolve`
// once it becomes a standard.
//
// Note: we could use `../../..` as the URL here to inline workerHelpers.js
// into the parent entry instead of creating another split point -
// this would be preferable from optimization perspective -
// however, Webpack then eliminates all message handler code
// because wasm-pack produces "sideEffects":false in package.json
// unconditionally.
//
// The only way to work around that is to have side effect code
// in an entry point such as Worker file itself.
const worker = new Worker(new URL('./workerHelpers.js', import.meta.url), {
type: 'module'
});
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Webpack warning using webworker: Circular dependency ...
Everything works fine if I close the warning out, and I'm not clear what "This prevents using hashes of each other" means in...
Read more >How to Eliminate Circular Dependencies from Your JavaScript ...
In the Node.js docs, it says, “Careful planning is required to allow cyclic module dependencies to work correctly within an application.”.
Read more >aackerman/circular-dependency-plugin - webpack@5 support
I have commented out the plugin in the webpack.config.js, uncommenting should show the error we are seeing. Webpack - 5.1.3
Read more >How to Analyze Circular Dependencies in ES6? - Railsware
It will produce output like the following. WARNING in Circular dependency detected: app/assets/javascripts/process_allocations.js -> app/assets/ ...
Read more >How to fix nasty circular dependency issues once and for all in ...
The case. The module loading order in JavaScript is deterministic. Yet it is not very easy to follow in large projects. The reason...
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
It is intended, yes, hence feel free to close. Side-note: as a Ukrainian, I’m currently not super-inclined to look at code and will be slow to respond to issues.
Close it now as a kind of documentation.
OT: I wish all ukrainian people and the russian people which were arrested because of demonstration peace in the world. ☮