📖 Description
webpack@5 depends on enhanced-resolve using a semver range (^5.x.x).
After upgrading (via fresh install / lockfile update), enhanced-resolve@5.21.0 gets installed, which introduces a breaking change in resolveContext.stack.
This breaks existing webpack plugins relying on resolver hooks.
🔁 Where the issue occurs
Custom plugin using:
resolver.hooks.resolved.tapAsync(
pluginName,
async (originalResolved, resolveContext, callback) => {
// depends on resolveContext.stack
callback();
}
);
Behavior with enhanced-resolve 5.20.0
- resolveContext.stack is a Set
- Iterable and stable
- Works correctly for deduplication logic
Behavior with enhanced-resolve 5.21.0
resolveContext.stack is now an object:
{
parent: {},
path: '',
module: true | false
}
⚠️ Issues Observed
- Breaking change in structure
- Set → Object
- Not iterable → breaks existing plugins
- Inconsistent resolution metadata
- module flag missing or incorrect in some cases
📖 Description
webpack@5depends onenhanced-resolveusing a semver range (^5.x.x).After upgrading (via fresh install / lockfile update),
enhanced-resolve@5.21.0gets installed, which introduces a breaking change inresolveContext.stack.This breaks existing webpack plugins relying on resolver hooks.
🔁 Where the issue occurs
Custom plugin using:
Behavior with enhanced-resolve 5.20.0
Behavior with enhanced-resolve 5.21.0
resolveContext.stack is now an object: