# IONIC 4 - Can't resolve all parameters for NavParams

**URL:** <https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302>\
**Category:** Ionic Framework\
**Created:** [December 14, 2018, 2:47am UTC](https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302 "2018-12-14T02:47:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mosheinf](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@mosheinf](https://forum.ionicframework.com/u/mosheinf)\
**Post date:** [December 14, 2018, 2:47am UTC](https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302/1 "2018-12-14T02:47:32Z")

</div>

When i add the line (private navParams: NavParams,) to constructor() of any new page i receive this error: Can’t resolve all parameters for NavParams

I’m running Ionic 4.5.0  
I tried a new clean project. Same error.

I tried to import NavParams at app.module.ts or at my page.module.ts but others erros occurs.

This error happens even if no use of NavParams is done.  
Only type “private navParams: NavParams” to the page construct() is enough to the error appears.

Thanks

---

<div class="post-metadata">

**Author:** ![ChrisGriiffith](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/chrisgriiffith/32/66576_2.png) [@ChrisGriiffith](https://forum.ionicframework.com/u/ChrisGriiffith)\
**Post date:** [December 14, 2018, 5:28pm UTC](https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302/2 "2018-12-14T17:28:48Z")

</div>

Which version of Ionic? You listed the CLI version number in your post.

---

<div class="post-metadata">

**Author:** ![mosheinf](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@mosheinf](https://forum.ionicframework.com/u/mosheinf)\
**Post date:** [December 14, 2018, 8:02pm UTC](https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302/3 "2018-12-14T20:02:07Z")

</div>

Sorry.  
@ionic/angular 4.0.0-beta.17

ionic (Ionic CLI) : 4.5.0  
Ionic Framework : @ionic/angular 4.0.0-beta.17  
@angular-devkit/build-angular : 0.10.7  
@angular-devkit/schematics : 7.0.7  
@angular/cli : 7.0.7  
@ionic/angular-toolkit : 1.2.0

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [December 14, 2018, 8:20pm UTC](https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302/4 "2018-12-14T20:20:15Z")

</div>

Ionic’s lazy loading is so fragile. I recommend completely ignoring it and removing all submodules in favor of putting everything in a monolithic app module. Your problem is likely caused by `IonicModule` not being imported where needed.

---

<div class="post-metadata">

**Author:** ![Lachu](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Lachu](https://forum.ionicframework.com/u/Lachu)\
**Post date:** [June 19, 2019, 9:40am UTC](https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302/5 "2019-06-19T09:40:50Z")

</div>

How can I import Ionic module please explain it clearly …!!!

---

<div class="post-metadata">

**Author:** ![dayanajabif](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dayanajabif/32/126298_2.png) [@dayanajabif](https://forum.ionicframework.com/u/dayanajabif)\
**Post date:** [June 19, 2019, 1:42pm UTC](https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302/6 "2019-06-19T13:42:57Z")

</div>

Hey @Lachu, I created [a github repo](https://github.com/ionicthemes/ionic4-starter-app) with an example Ionic 4 app where you can see how to import Ionic modules and more.  
Hope it helps!

---

<div class="post-metadata">

**Author:** ![Lachu](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Lachu](https://forum.ionicframework.com/u/Lachu)\
**Post date:** [June 19, 2019, 6:51pm UTC](https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302/7 "2019-06-19T18:51:55Z")

</div>

**Group page.html**

 My Groups ![]()
### {{ item.groupName }}

**Groups.page.ts**  
import { Component, OnInit } from ‘@angular/core’;  
import { NavController, Events, LoadingController } from ‘@ionic/angular’;  
import { GroupsService } from ‘…/services/groups.service’;  
import { Router, ActivatedRoute } from ‘@angular/router’;  
@Component({  
selector: ‘app-groups’,  
templateUrl: ‘./groups.page.html’,  
styleUrls: [’./groups.page.scss’],  
})  
export class GroupsPage implements OnInit {  
allmygroups:any;

constructor(private route:Router,private router:ActivatedRoute,private grpService:GroupsService,private loadingCtrl:LoadingController,private navCtrl:NavController,private events:Events) { }

ngOnInit() {  
}

openchat(group) {  
this.grpService.getintogroup(group.groupName);  
[//this.navCtrl.navigateRoot](https://this.navCtrl.navigateRoot)(‘groupchat’,group.groupName);  
let groupName = group.groupName;  
this.route.navigate([‘groupchat’,groupName]);  
}  
}

**groupchat.page.ts**  
import { Component, OnInit, Inject, ViewChild } from ‘@angular/core’;  
import { ActionSheetController, NavController } from ‘@ionic/angular’;  
import { GroupsService } from ‘…/services/groups.service’;  
import { Router, ActivatedRoute, } from ‘@angular/router’;

@Component({  
selector: ‘app-groupchat’,  
templateUrl: ‘./groupchat.page.html’,  
styleUrls: [’./groupchat.page.scss’],  
})  
export class GroupchatPage implements OnInit {  
owner: boolean = false;  
groupName:any = ;

constructor(private route:Router,private router:ActivatedRoute,private navCtrl:NavController,private actionSheet:ActionSheetController,private grpService:GroupsService) {  
[//this.groupName](https://this.groupName) = this.navParams.get(‘groupName’);  
this.groupName = this.router.snapshot.paramMap.get(‘groupName’);  
this.grpService.getownership(this.groupName).then((res) =\> {  
if(res)  
this.owner = true;  
}).catch((err) =\> {  
alert(err);  
})  
}

**app.routing,module.ts**  
import { NgModule } from ‘@angular/core’;  
import { PreloadAllModules, RouterModule, Routes,Router } from ‘@angular/router’;

const routes: Routes = [  
{ path: ‘’, redirectTo: ‘login’, pathMatch: ‘full’ },  
{ path: ‘login’, loadChildren: ‘./login/login.module#LoginPageModule’ },  
{ path: ‘tabs’, loadChildren: ‘./tabs/tabs.module#TabsPageModule’ },  
{ path: ‘chats’, loadChildren: ‘./chats/chats.module#ChatsPageModule’ },  
{ path: ‘groups’, loadChildren: ‘./groups/groups.module#GroupsPageModule’ },  
{ path: ‘profile’, loadChildren: ‘./profile/profile.module#ProfilePageModule’ },  
{ path: ‘buddies’, loadChildren: ‘./buddies/buddies.module#BuddiesPageModule’ },  
{ path: ‘buddychat’, loadChildren: ‘./buddychat/buddychat.module#BuddychatPageModule’ },  
{ path: ‘passwordreset’, loadChildren: ‘./passwordreset/passwordreset.module#PasswordresetPageModule’ },  
{ path: ‘profilepic’, loadChildren: ‘./profilepic/profilepic.module#ProfilepicPageModule’ },  
{ path: ‘signup’, loadChildren: ‘./signup/signup.module#SignupPageModule’ },  
{ path: ‘newgroup’, loadChildren: ‘./newgroup/newgroup.module#NewgroupPageModule’ },  
{ path: ‘groupchat/groupName’, loadChildren: ‘./groupchat/groupchat.module#GroupchatPageModule’ },  
{ path: ‘groupbuddies’, loadChildren: ‘./groupbuddies/groupbuddies.module#GroupbuddiesPageModule’ },  
{ path: ‘groupmembers’, loadChildren: ‘./groupmembers/groupmembers.module#GroupmembersPageModule’ },  
{ path: ‘groupinfo’, loadChildren: ‘./groupinfo/groupinfo.module#GroupinfoPageModule’ },  
];

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

This is my code I have an error while routing to **groupchat page** from **group page** by using this code **openchat(group) {**  
\*\* this.grpService.getintogroup(group.groupName);\*\*  
\*\* [//this.navCtrl.navigateRoot](https://this.navCtrl.navigateRoot)(‘groupchat’,group.groupName);\*\*  
\*\* let groupName = group.groupName;\*\*  
\*\* this.route.navigate([‘groupchat’,groupName]);\*\*  
\*\* }\*\*

**THIS IS MY ERROR PLEASE HELP ME OUT**

core.js:15724 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: ‘groupchat/Mortal%20Kombat’  
Error: Cannot match any routes. URL Segment: ‘groupchat/Mortal%20Kombat’  
at ApplyRedirects.push…/node\_modules/@angular/router/fesm5/router.js.ApplyRedirects.noMatchError (router.js:2469)  
at CatchSubscriber.selector (router.js:2450)  
at CatchSubscriber.push…/node\_modules/rxjs/\_esm5/internal/operators/catchError.js.CatchSubscriber.error (catchError.js:34)  
at MapSubscriber.push…/node\_modules/rxjs/\_esm5/internal/Subscriber.js.Subscriber.\_error (Subscriber.js:79)  
at MapSubscriber.push…/node\_modules/rxjs/\_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:59)  
at MapSubscriber.push…/node\_modules/rxjs/\_esm5/internal/Subscriber.js.Subscriber.\_error (Subscriber.js:79)  
at MapSubscriber.push…/node\_modules/rxjs/\_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:59)  
at MapSubscriber.push…/node\_modules/rxjs/\_esm5/internal/Subscriber.js.Subscriber.\_error (Subscriber.js:79)  
at MapSubscriber.push…/node\_modules/rxjs/\_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:59)  
at ThrowIfEmptySubscriber.push…/node\_modules/rxjs/\_esm5/internal/Subscriber.js.Subscriber.\_error (Subscriber.js:79)  
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)  
at ZoneTask.push…/node\_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:502)  
at invokeTask (zone.js:1744)

---

<div class="post-metadata">

**Author:** ![Lachu](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Lachu](https://forum.ionicframework.com/u/Lachu)\
**Post date:** [June 19, 2019, 7:13pm UTC](https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302/8 "2019-06-19T19:13:16Z")

</div>

Thank you @dayanajabif for your help…!!!

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:03pm UTC](https://forum.ionicframework.com/t/ionic-4-cant-resolve-all-parameters-for-navparams/150302/9 "2021-07-19T21:03:48Z")

</div>

Closed on July 19, 2021, 9:03pm UTC


