Closed laubuur closed 1 month ago
Yes, that's right. Currently we need to have exactly the same version to make it shared. Otherweise, each version is loaded. We plan to add all the semantics regarding semver we know from Module Federation eventually.
However, the current behavior is the better one in the Angular world as code compiled with Angular X expects to see the exact same version at runtime.
I recently migrated my project from Angular 16 to Angular 17. I switched to esbuild and consequently migrated from module federation to native federation. I have an issue that I didn't have before the update. (Same mfe configuration)
I have a library containing services intended to be used by all my micro-frontends. This service (SharedService) is provided in the shell's configuration: (Also tried to use the providedIn option in the @injectable decorator, same result)
I use this service in any MFE through dependency injection, and everything works correctly. However, if I update the version of the library (without even touching the code) in the shell but not in the MFE, I get the following error message in the browser console (when I go on a page who use the MFE):
federation.config.js - shell
federation.config.js - mfe
I tried setting strictVersion to true or false, nothing changes.
Shell - dependencies package.json
MFE - dependencies package.json