# IONIC-3 NavController throwing can't resolve all parameters error

**URL:** <https://forum.ionicframework.com/t/ionic-3-navcontroller-throwing-cant-resolve-all-parameters-error/140523>\
**Category:** ionic-v3\
**Created:** [September 2, 2018, 6:41pm UTC](https://forum.ionicframework.com/t/ionic-3-navcontroller-throwing-cant-resolve-all-parameters-error/140523 "2018-09-02T18:41:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan-london](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@dan-london](https://forum.ionicframework.com/u/dan-london)\
**Post date:** [September 2, 2018, 6:41pm UTC](https://forum.ionicframework.com/t/ionic-3-navcontroller-throwing-cant-resolve-all-parameters-error/140523/1 "2018-09-02T18:41:03Z")

</div>

I have an interesting problem with IONIC-3 that I’ve not been able to solve. I am attempting to implement an auth routing which is triggered by ionViewCanEnter. However, while I can pass one nav setter, it will not allow multiple. Here is the code:

**AuthService Function:**

```auto
isAuthenticated(nav: NavController): boolean | Promise<any> {
const userAuth = this.uData.getAuthenticated;
const userProfile = this.uData.getUserProfile;

if (userAuth ) {
  //User is logged in, so let's check a few things.
  if (!userProfile.sign_up_complete) {
    //User has not completed sign up
    setTimeout(() => { nav.setRoot(CreateAccountPage) }, 0);
  }
  return true
} else {
  //User is not authenticated, return to walkthrough
  setTimeout(() => { nav.setRoot(WalkthroughPage) }, 0);
  return false
}}

```

**Example calling:**

```auto
ionViewCanEnter(): boolean | Promise<any> {
    return this.auth.isAuthenticated(this.nav);
}

```

If I have only CreateAccountPage, the script runs fine. However, when I add WalkthroughPage, it throws the following error:

```auto
Error: Can't resolve all parameters for ListingPage: (?, [object Object], [object Object], [object Object]).

```

Which is an error related to the AuthService. For clarity the WalkthroughPage code is as follows:

```auto
import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, Slides } from 'ionic-angular';
import { RemoteConfigProvider } from '../../providers/remote-config/remote-config';

import { LoginPage } from '../login/login';
import { SignupPage } from '../signup/signup';

@IonicPage()
@Component({
  selector: 'walkthrough-page',
  templateUrl: 'walkthrough.html'
})
export class WalkthroughPage {

  lastSlide = false;

  sign_up_enabled: null;
  sign_in_enabled: null;

  @ViewChild('slider') slider: Slides;

  constructor(public nav: NavController,
    public remoteConfig: RemoteConfigProvider) {
  }

  ionViewDidLoad() {
    this.remoteConfig.getValue('sign_up_enabled').then(t => {
      this.sign_up_enabled = t;
    })

    this.remoteConfig.getValue('sign_in_enabled').then(t => {
      this.sign_in_enabled = t;
    })
  }

  skipIntro() {
    this.lastSlide = true;
    this.slider.slideTo(this.slider.length());
  }

  onSlideChanged() {
    this.lastSlide = this.slider.isEnd();
  }

  goToLogin() {
    this.nav.push(LoginPage);
  }

  goToSignup() {
    this.nav.push(SignupPage);
  }
}

```

I have attempted to compare both pages, but not identified the exact cause. I welcome any thoughts.

---

<div class="post-metadata">

**Author:** ![robinyo](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/robinyo/32/115964_2.png) [@robinyo](https://forum.ionicframework.com/u/robinyo)\
**Post date:** [September 11, 2018, 9:14pm UTC](https://forum.ionicframework.com/t/ionic-3-navcontroller-throwing-cant-resolve-all-parameters-error/140523/2 "2018-09-11T21:14:53Z")

</div>

@dan-london

Is your service marked as `@Injectable()`:

```auto
@Injectable()
export class AuthService {

  ...

}

```

---

<div class="post-metadata">

**Author:** ![dan-london](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@dan-london](https://forum.ionicframework.com/u/dan-london)\
**Post date:** [September 19, 2018, 10:50am UTC](https://forum.ionicframework.com/t/ionic-3-navcontroller-throwing-cant-resolve-all-parameters-error/140523/3 "2018-09-19T10:50:17Z")

</div>

I fixed this issue. For those interested, I used the deep-link reference for pages which overcame the error listed.

---

<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:18pm UTC](https://forum.ionicframework.com/t/ionic-3-navcontroller-throwing-cant-resolve-all-parameters-error/140523/4 "2021-07-19T21:18:06Z")

</div>


