0

My Angular-11 application was working fine, but suddenly I got this error:

Error: ./src/app/app.module.ts Module not found: Error: Can't resolve './app.component' in 'C:\xampp\htdocs\myapp\client\src\app'

Here is my app.module.ts:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {LayoutModule} from './layout/layout.module';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    BrowserAnimationsModule,
    LayoutModule
  ],
  providers: [],
  bootstrap: [AppComponent] 
})
export class AppModule { }

I restarted several times, but the error is still there.

Why this error and how do I resolve it?

Thanks

user11352561
  • 1,071
  • 1
  • 16
  • 39

0 Answers0