Ionic 5 - ASSERTION ERROR: Expecting flags

Viewed 736

I tried creating another page and modifying the paths but the error only appears when an ion-tabs is present.

And if I remove the component: MenuPage, the page works normally (without the tabs)

menu-routing.module.ts :

const routes: Routes = [
  {
    path: '',
    component: MenuPage,
    children: [
      {
        path: 'list',
        loadChildren: () => import('../list/list.module').then(m => m.ListPageModule),
      },
      {
        path: '',
        redirectTo: '/menu/list',
        pathMatch: 'full',
      },
    ],
  },
  {
    path: '',
    redirectTo: '/menu/list',
    pathMatch: 'full',
  },

];

menu.page.html :

<ion-content>
  <ion-tabs>
    <ion-tab-bar slot="bottom">

      <ion-tab-button tab="list">
        <ion-icon name="home-outline"></ion-icon>
        <ion-label>Home</ion-label>
      </ion-tab-button>

      <ion-tab-button>
        <ion-icon name="settings"></ion-icon>
        <ion-label>Settings</ion-label>
      </ion-tab-button>

    </ion-tab-bar>
  </ion-tabs>
</ion-content>

Error:

ERROR Error: Uncaught (in promise): Error: ASSERTION ERROR: Expecting flags [Expected=> number === boolean <=Actual]
Error: ASSERTION ERROR: Expecting flags [Expected=> number === boolean <=Actual]
    at throwError (core.js:210)
    at assertNumber (core.js:141)
    at Module.ɵɵcontentQuery (core.js:26536)
    at Object.IonTabs_ContentQueries [as contentQueries] (ionic-angular.js:3143)
    at executeContentQueries (core.js:9554)
    at ɵɵelementStart (core.js:14788)
    at MenuPage_Template (template.html:2)
    at executeTemplate (core.js:9538)
    at renderView (core.js:9345)
    at renderComponent (core.js:10620)
    at resolvePromise (zone-evergreen.js:798)
    at resolvePromise (zone-evergreen.js:750)
    at zone-evergreen.js:860
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
    at Object.onInvokeTask (core.js:28515)
    at ZoneDelegate.invokeTask (zone-evergreen.js:398)
    at Zone.runTask (zone-evergreen.js:167)
    at drainMicroTaskQueue (zone-evergreen.js:569)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:484)
    at invokeTask (zone-evergreen.js:1621)

EDIT: They are completely empty, don't add code actually

Menu.module.ts

@NgModule({
  imports: [
    IonicModule,
    CommonModule,
    FormsModule,
    MenuPageRoutingModule
  ],
  declarations: [MenuPage]
})
export class MenuPageModule {}

menu.page.ts:

@Component({
  selector: 'main-menu',
  templateUrl: './menu.page.html',
  styleUrls: ['./menu.page.scss'],
})
export class MenuPage {}

I don't know what to do.

0 Answers
Related