Angular reported an error: Cannot read property 'showCoverDefault' of undefined

here I just created two components and negotiated their routing switch
app-component.html file:

<a [routerLink]="["/"]"></a>
<a [routerLink]="["/product"]"></a>

<router-outlet></router-outlet>

app-routing.module.ts:
const routes: Routes = [
  {
    path: "",component:HomeComponent
  },
  {
    path: "product",component:ProductComponent
  }
];

this error did not affect the functional effectiveness of my project, but it is strange why the error was reported, and . The page you are watching at this time also seems to have this error.

Note: using VSCode compiler environment, Chrome browser, Win10 system 64-bit, angular5,NodeJS version 8.11.2 and Angularlycli version 1.7.4

Mar.16,2021

there must be a place in your code that calls something.showCoverDefault . This something has no value, so return undefined, and look carefully in the code.

Menu