Angular Modules not recognizing imported modules

I am trying to import a module into a home-page module, but it is throwing a TypeScript error stating that it cannot find the module despite the fact that it is defined. This is the terminal error -

ERROR in src/app/home-page/home-page.module.ts(11,5): error TS2304: Cannot find name ‘UtilityComponentModule’.

My UtilityComponentModule is set up-

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ModalWindowComponent } from './modal-window/modal-window.component';

@NgModule({
  imports: [
    CommonModule
  ],
  declarations: [
    ModalWindowComponent
  ],
  exports: [
    ModalWindowComponent
  ]
})
export class UtilityComponentModule { }

And the module I’m attempting to import it into is set up as -

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HomePageControllerComponent } from './home-page-controller/home-page-controller.component';
import { LanguageBarComponent } from './language-bar/language-bar.component';
import { SnippetAdderComponent } from './snippet-adder/snippet-adder.component';
import { SnippetCardComponent } from './snippet-card/snippet-card.component';

@NgModule({
  imports: [
    CommonModule,
    UtilityComponentModule
  ],
  declarations: [
    HomePageControllerComponent,
    LanguageBarComponent,
    SnippetAdderComponent,
    SnippetCardComponent
  ],
  exports: [
    HomePageControllerComponent
  ]
})
export class HomePageModule { }

Completely blindsided as to what could be causing this error.

Thank you in advance for any suggestions or direction you have.

Cheers!

Hi @RyanIndustries8, you have to actually import it in your HomePageModule:

import { UtilityComponentModule } from './path/to/utility-component.module.ts'
1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.