After running nx migrate
to upgrade from angular 15 to angular 16, I encountered errors when trying to run nx s
. The errors are as follows:
Error: apps/webshop/src/app/app.component.html:1:1 - error NG8001: 'eu-toolbar' is not a known element:
- If 'eu-toolbar' is an Angular component, ensure that it is part of this module.
- If 'eu-toolbar' is a Web Component, add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
1 < eu-toolbar class="eu-app__header">
apps/webshop/src/app/app.component.ts:22:16 22 templateUrl: './app.component.html', ~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component AppComponent.Error: apps/webshop/src/app/app.component.html:3:3 - error NG8001: 'router-outlet' is not a known element:
- If 'router-outlet' is an Angular component, verify that it is part of this module.
- If 'router-outlet' is a Web Component, add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3 ~~~~~~~~~~~~~~~
apps/webshop/src/app/app.component.ts:22:16 22 templateUrl: './app.component.html', ~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component AppComponent.
...
This issue appears to be related to a configuration error in my project post-upgrade, although everything was functioning properly in Angular 15. The correct declaration is in the app.module.ts file. Any guidance on where to investigate would be greatly appreciated.
app.component.html
<eu-toolbar class="eu-app__header"></eu-toolbar>
<div class="eu-app__content" #appContent (onResize)="handleItemResize($event)">
<router-outlet></router-outlet>
<eu-footer *ngIf="layout === 'eu-app--website'"></eu-footer>
</div>
app.module.ts
@NgModule({
declarations: [
AppComponent,
PageNotFoundComponent,
ToolbarComponent, <---
NavigationItemPipe,
DashboardComponent,
ShopcartFlyoutComponent,
NoCustomerAssignedComponent,
],
toolbar.component.ts
@Component({
selector: 'eu-toolbar',
templateUrl: './toolbar.component.html',
styleUrls: ['./toolbar.component.scss'],
})
export class ToolbarComponent implements OnInit, OnDestroy {