Application restart fails after code changes with Angular module dederation

55 Views Asked by At

I have several Angular applications that use Module federation. There is a main application, several MicroFrontends and a shared library.

All applications work perfectly when they are started using "ng serve". Only one application cannot be restarted if changes have been made to the code.

The following error occurs:

Error: src/app/modules/shared/components/component-name/component-name.component.ts:24:14

  • error NG3004: Unable to import directive DefaultValueAccessor. The symbol is not exported from .../node_modules/@angular/forms/index.d.ts (module '@angular/forms').

24 export class ComponentnameComponent extends ComponentFromSharedLibrary implements OnInit, OnDestroy { ~~~~~~~~~~~~~~~~~~~

node_modules/@angular/forms/index.d.ts:1324:1 1324 export declare class DefaultValueAccessor extends BaseControlValueAccessor implements ControlValueAccessor { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1325 private _compositionMode; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... 1335 static ɵdir: i0.ɵɵDirectiveDeclaration<DefaultValueAccessor, "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]", never, {}, {}, never, never, false, never>; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1336 } ~ The directive is declared here.

I have already compared all configurations with the working applications and have not recognized any differences.

It does not appear to be a local problem either. The error also occurs on other computers.

0

There are 0 best solutions below