webpack
webpack copied to clipboard
Compilation._handleModuleBuildAndDependencies's callback should get module when no error happening.
Bug report
What is the current behavior?
When module is being processed in processDependenciesQueue
, compilation._handleModuleBuildAndDependencies
callback with empty.
https://github.com/webpack/webpack/blob/1132eb3f38cc5d3365646e06022aef64b8015c61/lib/Compilation.js#L1939-L1942
If the current behavior is a bug, please provide the steps to reproduce. Module with circular dependencies.
What is the expected behavior?
I'm writing a webpack plugin which need call compilation.addEntry
and get the entry root module from callback, but in the circular case I can't get the entry root module from callback and without any error.
I don't know is this a intentional design but in my opinion module should be callbacked when no error happening, like this:
// This avoids deadlocks for circular dependencies
if (this.processDependenciesQueue.isProcessing(module)) {
return callback(null, module);
}
Other relevant information:
webpack version:
Node.js version:
Operating System:
Additional tools:
Directly callback with module is not accurate, perhaps it is better to wait for the current module's dependencies processing to be finished, and then invoke the outer callback such as compilation.addEntry
.
You are right. Send a PR
I'll like to submit a PR, please assign it to me.
I sent a PR making the changes mentioned by @hiyuki in the desc. If any modification is required let me know.
This issue had no activity for at least three months.
It's subject to automatic issue closing if there is no activity in the next 15 days.
bump