Base solution for your next web application
Open Closed

Adding own module generates compil error #4411


User avatar
0
chehrhard created

with v5 , angular and anpetcore. i created a new directory under src/app , at the same level than the main directory. I added a simple module

import {NgModule} from '@angular/core'; import {AppCommonModule} from '@app/shared/common/app-common.module'; import {UtilsModule} from '@shared/utils/utils.module'; import {CommonModule} from '@angular/common'; import {SellSySettingsComponent} from '@app/Sellsy/Settings/sellsy-settings.component';

@NgModule({ imports: [ CommonModule, AppCommonModule, UtilsModule, ], declarations: [SellSySettingsComponent]

}) export class SellsyModule { }

The component ( no html code )

import {AppComponentBase} from '@shared/common/app-component-base'; import {AfterViewInit, Component, OnDestroy, ViewEncapsulation} from '@angular/core'; import {appModuleAnimation} from '@shared/animations/routerTransition';

@Component ({ templateUrl: './sellsy-settings.component.html', encapsulation: ViewEncapsulation.None, animations: [appModuleAnimation()] }) export class SellSySettingsComponent extends AppComponentBase implements AfterViewInit, OnDestroy {

ngAfterViewInit(): void { }

ngOnDestroy() { }

}

at compilation i have this message

ERROR in ./src/app/sellsy/sellsy.module.ts Module build failed: Error: C:\EhciDev\StratosZero\StratosCore\angular\src\app\sellsy\sellsy.module.ts is not part of the compilation output. Please check the other error messages for details. at AngularCompilerPlugin.getCompiledFile (C:\EhciDev\StratosZero\StratosCore\angular\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:625:23) at plugin.done.then (C:\EhciDev\StratosZero\StratosCore\angular\node_modules@ngtools\webpack\src\loader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) @ ./src/$$_lazy_route_resource lazy @ ./node_modules/@angular/core/esm5/core.js @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

what am i doing wrong ?


2 Answer(s)
  • User Avatar
    0
    chehrhard created

    a precision : the module is not compiled. i can't see it as ...chunk.js .

    is this related with some lazy loading stuff ? how can i force this module to be generated ?

  • User Avatar
    0
    ismcagdas created
    Support Team

    @ChEhrhard, you need to import your module into one of the other modules, probably AppModule.