single-spa / single-spa-angular

Helpers for building single-spa applications which use Angular
Apache License 2.0
202 stars 78 forks source link

single spa - Angular - cross microfrontend import - angular service with nested deps #505

Open AnandSonake opened 7 months ago

AnandSonake commented 7 months ago

single spa - Angular - cross microfrontend import - angular service with nested deps

Description: We have separate repo for Root-config, navbar, container, admin MFEs. Currently we are facing service usage issue. Angular service is defined in a container mfe and we are trying to inject it in one of the components of admin mfe. We identified that if service does not have any dependency (i.e. not nested dep) then we are able to inject such service in admin's component but if service has another dep then it fails in admin mfe.

Example:

Container MFE:
    TenantService (Tenant Service has dep on SessionStorageService)
    SessionStorageService

Amdin MFE:
    ActivityComponent(dep: TenantService and others)

Here, ActivityComponent gives an error as TenantService is injected in it which has another dependency.

Libs:

alaindeurveilher commented 7 months ago

I am starting with single spa today. Just reading around, I noticed that the update for Angular 17 has not been released yet at this day, v9.0.1 is for Angular 16. Maybe it's due to incompatibilities. You should try maybe with the master branch instead of the v9.0.1 to see if your issue is gone?