webpack: Module Federation deps strictVersion mismatch source in error message

Feature request

What is the expected behavior? getStrictSingletonVersion throws more detailed error. Also will be great get all errors at once (not one per step)

This dramatically decrease spent time on module federation integration process.

What is motivation or use case for adding/changing the behavior? Adding module federation to huge porject i’m facing following problem: I’m unable do determine package, which declare mismatched strict version dependency, because only clue i’ve get is

Unsatisfied version 11.0.3 of shared singleton module @angular/core (required ^10.0.0)

Digging deeper i’ve found this (but it still don’t help me): image There are is a lot of older angular dependencies version, but - i can’t determine which package bring them there.

How should this be implemented in your opinion?

This:

Unsatisfied version 11.0.3 of shared singleton module @angular/core (required ^10.0.0)

Will be good to expanded to this:

Unsatisfied versions detected:
@angular/core (current 11.0.3)
   10.0.0 (by @ngrx/core)
   6.0.3 (by ngx-quicklinks)

Are you willing to work on this yourself? I’m not sure i can handle it, but i can try, if you give me few design clues.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 21
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Пожалуйста, используйте английский в будущем

You can comment and change code:

// import { Controls, NgxAutomaticRootFormComponent } from 'ngx-sub-form';

and all works fine

@snitin315 sure, thank you! @alexander-akait thanks for some clues, will back soon)

You can improve it here https://github.com/webpack/webpack/blob/master/lib/sharing/ConsumeSharedRuntimeModule.js, we have helpers like findVersion/findSingletonVersionKey https://github.com/webpack/webpack/blob/master/lib/sharing/ConsumeSharedRuntimeModule.js#L98, I think we need return not only versions, but also packages where this versions were used so it allows to improve error message

Я понимаю ваш вопрос и желание, я помечу это как улучшение, но это может быт не так легко решить как кажется, так как сборка может происходить независимо и имена могут в production может быть сжаты, хотя это имеет смысл для development режима