@lily28 wrote:
Hey, I’m new to ionic and currently doing my project. Tabs worked fine at first but I got an error after trying to navigate it after login. Not sure what i’m doing wrong any help would be appreciated, thanks.
Error
ERROR Error: Uncaught (in promise): Error: Cannot find module ‘…/pages/tab1/tab1.module’
Error: Cannot find module ‘…/pages/tab1/tab1.module’
at $_lazy_route_resource lazy namespace object:35
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Object.onInvoke (core.js:17299)
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390)
at Zone.push…/node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150)
at zone.js:889
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push…/node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at resolvePromise (zone.js:831)
at resolvePromise (zone.js:788)
at zone.js:892
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push…/node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at drainMicroTaskQueue (zone.js:601)
defaultErrorLogger @ core.js:15724
push…/node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:15772
next @ core.js:17771
schedulerFn @ core.js:13515
push…/node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:196
push…/node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:134
push…/node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:77
push…/node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:54
push…/node_modules/rxjs/_esm5/internal/Subject.js.Subject.next @ Subject.js:47
push…/node_modules/@angular/core/fesm5/core.js.EventEmitter.emit @ core.js:13499
(anonymous) @ core.js:17321
push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:391
push…/node_modules/zone.js/dist/zone.js.Zone.run @ zone.js:150
push…/node_modules/@angular/core/fesm5/core.js.NgZone.runOutsideAngular @ core.js:17258
onHandleError @ core.js:17321
push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.handleError @ zone.js:395
push…/node_modules/zone.js/dist/zone.js.Zone.runGuarded @ zone.js:164
_loop_1 @ zone.js:694
api.microtaskDrainDone @ zone.js:703
drainMicroTaskQueue @ zone.js:608
Promise.then (async)
scheduleMicroTask @ zone.js:584
push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:413
onScheduleTask @ zone.js:301
push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:404
push…/node_modules/zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:238
push…/node_modules/zone.js/dist/zone.js.Zone.scheduleMicroTask @ zone.js:258
scheduleResolveOrReject @ zone.js:879
resolvePromise @ zone.js:825
(anonymous) @ zone.js:741
webpackJsonpCallback @ bootstrap:25
(anonymous) @ pages-tabs-tabs-module.js:1app-routing.module.ts
import { NgModule } from ‘@angular/core’;
import { RouterModule, Routes } from ‘@angular/router’;const routes: Routes = [
{ path: ‘’, redirectTo: ‘tabs’, pathMatch: ‘full’ },
{ path: ‘login’, loadChildren: ‘./login/login.module#LoginPageModule’ },
{ path: ‘register’, loadChildren: ‘./register/register.module#RegisterPageModule’ },
{ path: ‘tabs’, loadChildren: ‘./pages/tabs/tabs.module#TabsPageModule’ },
{ path: ‘childdetails’, loadChildren: ‘./pages.childdetails.module#ChilddetailsPageModule’ },
];@NgModule({
imports: [
RouterModule.forRoot(routes)
],
exports: [RouterModule]
})
export class AppRoutingModule { }tabs.router.module.ts
import { RouterModule, Routes} from ‘@angular/router’;
import { NgModule } from ‘@angular/core’;
import { TabsPage } from ‘./tabs.page’;const routes: Routes = [
{
path: ‘’, //default
component: TabsPage, //localhost/tabs/…
children: [
{ path: ‘tab1’, loadChildren: ‘…/pages/tab1/tab1.module#Tab1PageModule’ },
{ path: ‘tab2’, loadChildren: ‘…/pages/tab2/tab2.module#Tab2PageModule’ },
{ path: ‘tab3’, loadChildren: ‘…/pages/tab3/tab3.module#Tab3PageModule’ },
]},
];
@NgModule({
imports: [
RouterModule.forChild(routes)
],
exports: [RouterModule]
})
export class TabsRoutingModule { }tabs.module.ts
import { NgModule } from ‘@angular/core’;
import { CommonModule } from ‘@angular/common’;
import { FormsModule } from ‘@angular/forms’;import { IonicModule } from ‘@ionic/angular’;
import { TabsPage } from ‘./tabs.page’;
import { TabsRoutingModule } from ‘./tabs.router.module’;@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
TabsRoutingModule
],
declarations: [TabsPage]
})
export class TabsPageModule {}other code, here is the repo https://github.com/Lilly08/Llly
Posts: 1
Participants: 1