Skip to content

Compilation._handleModuleBuildAndDependencies's callback should get module when no error happening. #16045

@hiyuki

Description

@hiyuki

Bug report

What is the current behavior?
When module is being processed in processDependenciesQueue, compilation._handleModuleBuildAndDependencies callback with empty.

webpack/lib/Compilation.js

Lines 1939 to 1942 in 1132eb3

// This avoids deadlocks for circular dependencies
if (this.processDependenciesQueue.isProcessing(module)) {
return callback();
}

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions