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.

Webpack warning of circular dependencies inside workerHelper.js

See original GitHub issue
WARNING 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:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
RReversercommented, Mar 22, 2022

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.

1reaction
codeart1stcommented, Mar 23, 2022

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. ☮

Read more comments on GitHub >

github_iconTop 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 >

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