dkhrunov / ngx-mfe

Angular library for working with micro-frontends in Webpack 5 and plugin ModuleFederation
https://www.npmjs.com/package/ngx-mfe
MIT License
22 stars 4 forks source link

Multiple mfeOutlet in the same page. #4

Closed hmendezm closed 2 years ago

hmendezm commented 2 years ago

Hi dkhrunov,

first of all, Thank you very much for putting this directive together. I am using it and works very nicely. The only issue I have is when I try to add more than one mfeOutlet on the page. For instance, the page has a header, footer, and body. each of them needs to have mfeOutlet.

 <ng-container *mfeOutlet="'XXXX/XXXXXX'"></ng-container>
 <ng-container *mfeOutlet="'YYYYYY/YYYYY'"></ng-container>

Error:

ngx-mfe.mjs:317 TypeError: (0 , rxjs__WEBPACK_IMPORTED_MODULE_2__.lastValueFrom) is not a function
    at ngx-mfe.mjs:207:37
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:25:1)
    at asyncToGenerator.js:32:1
    at new ZoneAwarePromise (zone.js:1387:1)
    at asyncToGenerator.js:21:1
    at MfeComponentFactoryResolver.resolveComponentFactory (ngx-mfe.mjs:203:122)
    at ngx-mfe.mjs:339:55
    at Generator.next (<anonymous>)

Thank you very much! hmendezm

hmendezm commented 2 years ago

Nevermind. My error was caused by rxjs version. I had 6.6.6 and I have to update to rxjs 7.x

dkhrunov commented 2 years ago

Nevermind. My error was caused by rxjs version. I had 6.6.6 and I have to update to rxjs 7.x

Ok, I add this requirements as peer dependency into lib