Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.3K
Views
Cannot resolve symbol 'router-outlet'

The project is based on Angular 13.

Added routing to the project. app-routing.module.ts

import { NgModule } from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import {HomePageComponent} from "./home-page/home-page.component";

const appRoutes: Routes =[
  { path: '', component: HomePageComponent}
];

@NgModule({
  imports: [RouterModule.forRoot(appRoutes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }

added AppRoutingModule to the file app.module.ts

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import {ModalModule} from "ngb-modal";
import {FormsModule} from "@angular/forms";
import { HomePageComponent } from './home-page/home-page.component';
import {AppRoutingModule} from "./app-routing.module";

@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    AppRoutingModule
  ],
  declarations: [
    AppComponent,
    HomePageComponent
  ],

  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

but if I try to add to the file app.component.html

<router-outlet></router-outlet>

IDEA throws an error

Cannot resolve symbol 'router-outlet'

But if I open another project with routing in the same IDE, there is no such error.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I guess you are using WebStorm as an IDE, since i also ran into that warning when i upgraded my project to Angular 13, yet i didn't it on VSC.

Apparently in order to solve it you need to upgrade WebStorm to 2021.3. I recommend using JetBrains's toolbox app, which makes it easy to update.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!