Ionic 4 / Angular Routing: ERROR Error: Uncaught (in promise): Error: Cannot find 'EventHomePageModule' in...











up vote
0
down vote

favorite












I am experimenting with Ionic 4 Beta 15, released yesterday.



Here is my AppRoutingModule



const routes: Routes            =   [{ 
path : '',
loadChildren : './tabs/tabs.module#TabsPageModule'
/*
}, {
path : 'event/:id',
loadChildren : './event/event.module#EventModule'
}, {
path : 'ngo/:id',
loadChildren : './ngo/ngo.module#NgoModule'
*/
}, {
path : 'volunteer/:id',
loadChildren : './volunteer/volunteer.module#VolunteerModule'

}];

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


As given in above code, If I comment out any 2 of 3 paths, Event, Ngo or Volunteer, routing is working good.



But when I enable any of the 2 paths together, I am getting the following error:



Error: Cannot find 'NgoHomePageModule' in './home/home.module'
at checkNotEmpty (core.js:5007)
at core.js:4984
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:3820)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138)
at zone.js:872
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:3811)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
at checkNotEmpty (core.js:5007)


It happens randomly with NGO or with Volunteer on each ionic serve



Routing in my VolunteerModule



const routes = [{
path : 'home',
loadChildren : './home/home.module#VolunteerHomePageModule'
}, {
path : 'event',
loadChildren : './event/event.module#VolunteerEventPageModule'
}, {
path : 'achievement',
loadChildren : './achievement/achievement.module#VolunteerAchievementPageModule'
}, {
path : '',
redirectTo : 'home'
}];


Routing in my NgoModule



const routes = [{
path : 'home',
loadChildren : './home/home.module#NgoHomePageModule'
}, {
path : 'upcoming',
loadChildren : './upcoming /upcoming.module#NgoUpcomingPageModule'
}, {
path : 'past',
loadChildren : './past/past.module#NgoPastPageModule'
}, {
path : 'volunteer',
loadChildren : './volunteer/volunteer.module#NgoVolunteerPageModule'
}, {
path : '',
redirectTo : 'home'
}];


My Folder structure:



▾ ngo/
▸ home/
▸ past/
▸ upcoming/
▸ volunteer/
[  ]ngo.module.spec.ts
[  ]ngo.module.ts
▸ tabs/
▾ volunteer/
▸ achievement/
▸ event/
▸ home/
[  ]volunteer.module.spec.ts
[  ]volunteer.module.ts
[  ]app-routing.module.ts


Update 1:
Uploaded the Repo to
https://gitlab.com/saiy2k/ionic.4-beta.15-routing-issue



What am I doing wrong? Please help.










share|improve this question
























  • create stackblitz, it would be helpful to identify the problem.
    – Suresh Kumar Ariya
    Nov 3 at 16:40










  • @SureshKumarAriya Couldn't make it work in Stackblitz (probably becoz of github.com/stackblitz/core/issues/724 or I am new to it) So uploaded the repo to gitlab and updated the post with link to it. Thanks.
    – saiy2k
    Nov 4 at 9:45















up vote
0
down vote

favorite












I am experimenting with Ionic 4 Beta 15, released yesterday.



Here is my AppRoutingModule



const routes: Routes            =   [{ 
path : '',
loadChildren : './tabs/tabs.module#TabsPageModule'
/*
}, {
path : 'event/:id',
loadChildren : './event/event.module#EventModule'
}, {
path : 'ngo/:id',
loadChildren : './ngo/ngo.module#NgoModule'
*/
}, {
path : 'volunteer/:id',
loadChildren : './volunteer/volunteer.module#VolunteerModule'

}];

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


As given in above code, If I comment out any 2 of 3 paths, Event, Ngo or Volunteer, routing is working good.



But when I enable any of the 2 paths together, I am getting the following error:



Error: Cannot find 'NgoHomePageModule' in './home/home.module'
at checkNotEmpty (core.js:5007)
at core.js:4984
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:3820)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138)
at zone.js:872
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:3811)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
at checkNotEmpty (core.js:5007)


It happens randomly with NGO or with Volunteer on each ionic serve



Routing in my VolunteerModule



const routes = [{
path : 'home',
loadChildren : './home/home.module#VolunteerHomePageModule'
}, {
path : 'event',
loadChildren : './event/event.module#VolunteerEventPageModule'
}, {
path : 'achievement',
loadChildren : './achievement/achievement.module#VolunteerAchievementPageModule'
}, {
path : '',
redirectTo : 'home'
}];


Routing in my NgoModule



const routes = [{
path : 'home',
loadChildren : './home/home.module#NgoHomePageModule'
}, {
path : 'upcoming',
loadChildren : './upcoming /upcoming.module#NgoUpcomingPageModule'
}, {
path : 'past',
loadChildren : './past/past.module#NgoPastPageModule'
}, {
path : 'volunteer',
loadChildren : './volunteer/volunteer.module#NgoVolunteerPageModule'
}, {
path : '',
redirectTo : 'home'
}];


My Folder structure:



▾ ngo/
▸ home/
▸ past/
▸ upcoming/
▸ volunteer/
[  ]ngo.module.spec.ts
[  ]ngo.module.ts
▸ tabs/
▾ volunteer/
▸ achievement/
▸ event/
▸ home/
[  ]volunteer.module.spec.ts
[  ]volunteer.module.ts
[  ]app-routing.module.ts


Update 1:
Uploaded the Repo to
https://gitlab.com/saiy2k/ionic.4-beta.15-routing-issue



What am I doing wrong? Please help.










share|improve this question
























  • create stackblitz, it would be helpful to identify the problem.
    – Suresh Kumar Ariya
    Nov 3 at 16:40










  • @SureshKumarAriya Couldn't make it work in Stackblitz (probably becoz of github.com/stackblitz/core/issues/724 or I am new to it) So uploaded the repo to gitlab and updated the post with link to it. Thanks.
    – saiy2k
    Nov 4 at 9:45













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am experimenting with Ionic 4 Beta 15, released yesterday.



Here is my AppRoutingModule



const routes: Routes            =   [{ 
path : '',
loadChildren : './tabs/tabs.module#TabsPageModule'
/*
}, {
path : 'event/:id',
loadChildren : './event/event.module#EventModule'
}, {
path : 'ngo/:id',
loadChildren : './ngo/ngo.module#NgoModule'
*/
}, {
path : 'volunteer/:id',
loadChildren : './volunteer/volunteer.module#VolunteerModule'

}];

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


As given in above code, If I comment out any 2 of 3 paths, Event, Ngo or Volunteer, routing is working good.



But when I enable any of the 2 paths together, I am getting the following error:



Error: Cannot find 'NgoHomePageModule' in './home/home.module'
at checkNotEmpty (core.js:5007)
at core.js:4984
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:3820)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138)
at zone.js:872
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:3811)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
at checkNotEmpty (core.js:5007)


It happens randomly with NGO or with Volunteer on each ionic serve



Routing in my VolunteerModule



const routes = [{
path : 'home',
loadChildren : './home/home.module#VolunteerHomePageModule'
}, {
path : 'event',
loadChildren : './event/event.module#VolunteerEventPageModule'
}, {
path : 'achievement',
loadChildren : './achievement/achievement.module#VolunteerAchievementPageModule'
}, {
path : '',
redirectTo : 'home'
}];


Routing in my NgoModule



const routes = [{
path : 'home',
loadChildren : './home/home.module#NgoHomePageModule'
}, {
path : 'upcoming',
loadChildren : './upcoming /upcoming.module#NgoUpcomingPageModule'
}, {
path : 'past',
loadChildren : './past/past.module#NgoPastPageModule'
}, {
path : 'volunteer',
loadChildren : './volunteer/volunteer.module#NgoVolunteerPageModule'
}, {
path : '',
redirectTo : 'home'
}];


My Folder structure:



▾ ngo/
▸ home/
▸ past/
▸ upcoming/
▸ volunteer/
[  ]ngo.module.spec.ts
[  ]ngo.module.ts
▸ tabs/
▾ volunteer/
▸ achievement/
▸ event/
▸ home/
[  ]volunteer.module.spec.ts
[  ]volunteer.module.ts
[  ]app-routing.module.ts


Update 1:
Uploaded the Repo to
https://gitlab.com/saiy2k/ionic.4-beta.15-routing-issue



What am I doing wrong? Please help.










share|improve this question















I am experimenting with Ionic 4 Beta 15, released yesterday.



Here is my AppRoutingModule



const routes: Routes            =   [{ 
path : '',
loadChildren : './tabs/tabs.module#TabsPageModule'
/*
}, {
path : 'event/:id',
loadChildren : './event/event.module#EventModule'
}, {
path : 'ngo/:id',
loadChildren : './ngo/ngo.module#NgoModule'
*/
}, {
path : 'volunteer/:id',
loadChildren : './volunteer/volunteer.module#VolunteerModule'

}];

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


As given in above code, If I comment out any 2 of 3 paths, Event, Ngo or Volunteer, routing is working good.



But when I enable any of the 2 paths together, I am getting the following error:



Error: Cannot find 'NgoHomePageModule' in './home/home.module'
at checkNotEmpty (core.js:5007)
at core.js:4984
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:3820)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138)
at zone.js:872
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:3811)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
at checkNotEmpty (core.js:5007)


It happens randomly with NGO or with Volunteer on each ionic serve



Routing in my VolunteerModule



const routes = [{
path : 'home',
loadChildren : './home/home.module#VolunteerHomePageModule'
}, {
path : 'event',
loadChildren : './event/event.module#VolunteerEventPageModule'
}, {
path : 'achievement',
loadChildren : './achievement/achievement.module#VolunteerAchievementPageModule'
}, {
path : '',
redirectTo : 'home'
}];


Routing in my NgoModule



const routes = [{
path : 'home',
loadChildren : './home/home.module#NgoHomePageModule'
}, {
path : 'upcoming',
loadChildren : './upcoming /upcoming.module#NgoUpcomingPageModule'
}, {
path : 'past',
loadChildren : './past/past.module#NgoPastPageModule'
}, {
path : 'volunteer',
loadChildren : './volunteer/volunteer.module#NgoVolunteerPageModule'
}, {
path : '',
redirectTo : 'home'
}];


My Folder structure:



▾ ngo/
▸ home/
▸ past/
▸ upcoming/
▸ volunteer/
[  ]ngo.module.spec.ts
[  ]ngo.module.ts
▸ tabs/
▾ volunteer/
▸ achievement/
▸ event/
▸ home/
[  ]volunteer.module.spec.ts
[  ]volunteer.module.ts
[  ]app-routing.module.ts


Update 1:
Uploaded the Repo to
https://gitlab.com/saiy2k/ionic.4-beta.15-routing-issue



What am I doing wrong? Please help.







angular angular2-routing lazy-loading ionic4






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 4 at 9:43

























asked Nov 3 at 14:46









saiy2k

1,26911630




1,26911630












  • create stackblitz, it would be helpful to identify the problem.
    – Suresh Kumar Ariya
    Nov 3 at 16:40










  • @SureshKumarAriya Couldn't make it work in Stackblitz (probably becoz of github.com/stackblitz/core/issues/724 or I am new to it) So uploaded the repo to gitlab and updated the post with link to it. Thanks.
    – saiy2k
    Nov 4 at 9:45


















  • create stackblitz, it would be helpful to identify the problem.
    – Suresh Kumar Ariya
    Nov 3 at 16:40










  • @SureshKumarAriya Couldn't make it work in Stackblitz (probably becoz of github.com/stackblitz/core/issues/724 or I am new to it) So uploaded the repo to gitlab and updated the post with link to it. Thanks.
    – saiy2k
    Nov 4 at 9:45
















create stackblitz, it would be helpful to identify the problem.
– Suresh Kumar Ariya
Nov 3 at 16:40




create stackblitz, it would be helpful to identify the problem.
– Suresh Kumar Ariya
Nov 3 at 16:40












@SureshKumarAriya Couldn't make it work in Stackblitz (probably becoz of github.com/stackblitz/core/issues/724 or I am new to it) So uploaded the repo to gitlab and updated the post with link to it. Thanks.
– saiy2k
Nov 4 at 9:45




@SureshKumarAriya Couldn't make it work in Stackblitz (probably becoz of github.com/stackblitz/core/issues/724 or I am new to it) So uploaded the repo to gitlab and updated the post with link to it. Thanks.
– saiy2k
Nov 4 at 9:45












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Made it work, but unbelievable solution.



Renamed the sub folders of the features with a unique name, as follows:



▾ ngo/
▸ home/ --> nhome/
▸ past/ --> npast/
▸ upcoming/ --> nupcoming/
▸ volunteer/ --> nvolunteer/
[  ]ngo.module.spec.ts
[  ]ngo.module.ts
▸ tabs/
▾ volunteer/
▸ achievement/ --> vachievement/
▸ event/ --> vevent/
▸ home/ --> vhome/
[  ]volunteer.module.spec.ts
[  ]volunteer.module.ts
[  ]app-routing.module.ts


This change resolved the issue. But I dont understand why! Any explanation for this?



Pushed the same to https://gitlab.com/saiy2k/ionic.4-beta.15-routing-issue/tree/fix






share|improve this answer





















  • I think we just fount an Angular bug.
    – skabir
    Nov 15 at 18:17











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53132409%2fionic-4-angular-routing-error-error-uncaught-in-promise-error-cannot-fin%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










Made it work, but unbelievable solution.



Renamed the sub folders of the features with a unique name, as follows:



▾ ngo/
▸ home/ --> nhome/
▸ past/ --> npast/
▸ upcoming/ --> nupcoming/
▸ volunteer/ --> nvolunteer/
[  ]ngo.module.spec.ts
[  ]ngo.module.ts
▸ tabs/
▾ volunteer/
▸ achievement/ --> vachievement/
▸ event/ --> vevent/
▸ home/ --> vhome/
[  ]volunteer.module.spec.ts
[  ]volunteer.module.ts
[  ]app-routing.module.ts


This change resolved the issue. But I dont understand why! Any explanation for this?



Pushed the same to https://gitlab.com/saiy2k/ionic.4-beta.15-routing-issue/tree/fix






share|improve this answer





















  • I think we just fount an Angular bug.
    – skabir
    Nov 15 at 18:17















up vote
0
down vote



accepted










Made it work, but unbelievable solution.



Renamed the sub folders of the features with a unique name, as follows:



▾ ngo/
▸ home/ --> nhome/
▸ past/ --> npast/
▸ upcoming/ --> nupcoming/
▸ volunteer/ --> nvolunteer/
[  ]ngo.module.spec.ts
[  ]ngo.module.ts
▸ tabs/
▾ volunteer/
▸ achievement/ --> vachievement/
▸ event/ --> vevent/
▸ home/ --> vhome/
[  ]volunteer.module.spec.ts
[  ]volunteer.module.ts
[  ]app-routing.module.ts


This change resolved the issue. But I dont understand why! Any explanation for this?



Pushed the same to https://gitlab.com/saiy2k/ionic.4-beta.15-routing-issue/tree/fix






share|improve this answer





















  • I think we just fount an Angular bug.
    – skabir
    Nov 15 at 18:17













up vote
0
down vote



accepted







up vote
0
down vote



accepted






Made it work, but unbelievable solution.



Renamed the sub folders of the features with a unique name, as follows:



▾ ngo/
▸ home/ --> nhome/
▸ past/ --> npast/
▸ upcoming/ --> nupcoming/
▸ volunteer/ --> nvolunteer/
[  ]ngo.module.spec.ts
[  ]ngo.module.ts
▸ tabs/
▾ volunteer/
▸ achievement/ --> vachievement/
▸ event/ --> vevent/
▸ home/ --> vhome/
[  ]volunteer.module.spec.ts
[  ]volunteer.module.ts
[  ]app-routing.module.ts


This change resolved the issue. But I dont understand why! Any explanation for this?



Pushed the same to https://gitlab.com/saiy2k/ionic.4-beta.15-routing-issue/tree/fix






share|improve this answer












Made it work, but unbelievable solution.



Renamed the sub folders of the features with a unique name, as follows:



▾ ngo/
▸ home/ --> nhome/
▸ past/ --> npast/
▸ upcoming/ --> nupcoming/
▸ volunteer/ --> nvolunteer/
[  ]ngo.module.spec.ts
[  ]ngo.module.ts
▸ tabs/
▾ volunteer/
▸ achievement/ --> vachievement/
▸ event/ --> vevent/
▸ home/ --> vhome/
[  ]volunteer.module.spec.ts
[  ]volunteer.module.ts
[  ]app-routing.module.ts


This change resolved the issue. But I dont understand why! Any explanation for this?



Pushed the same to https://gitlab.com/saiy2k/ionic.4-beta.15-routing-issue/tree/fix







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 15 at 17:55









saiy2k

1,26911630




1,26911630












  • I think we just fount an Angular bug.
    – skabir
    Nov 15 at 18:17


















  • I think we just fount an Angular bug.
    – skabir
    Nov 15 at 18:17
















I think we just fount an Angular bug.
– skabir
Nov 15 at 18:17




I think we just fount an Angular bug.
– skabir
Nov 15 at 18:17


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53132409%2fionic-4-angular-routing-error-error-uncaught-in-promise-error-cannot-fin%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?