# Error in :0:0 caused by: No provider for NavController!

**URL:** <https://forum.ionicframework.com/t/error-in-0-0-caused-by-no-provider-for-navcontroller/80584>\
**Category:** ionic-v3\
**Created:** [February 22, 2017, 5:26pm UTC](https://forum.ionicframework.com/t/error-in-0-0-caused-by-no-provider-for-navcontroller/80584 "2017-02-22T17:26:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![imenou](https://avatars.discourse-cdn.com/v4/letter/i/49beb7/32.png) [@imenou](https://forum.ionicframework.com/u/imenou)\
**Post date:** [February 22, 2017, 5:26pm UTC](https://forum.ionicframework.com/t/error-in-0-0-caused-by-no-provider-for-navcontroller/80584/1 "2017-02-22T17:26:03Z")

</div>

![image](https://global.discourse-cdn.com/ionicframework/original/3X/7/d/7dc786b5ce5b2b7d6f2faa7884a2f48ee469635e.png)

---

<div class="post-metadata">

**Author:** ![plmetz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/plmetz/32/106847_2.png) [@plmetz](https://forum.ionicframework.com/u/plmetz)\
**Post date:** [February 22, 2017, 6:31pm UTC](https://forum.ionicframework.com/t/error-in-0-0-caused-by-no-provider-for-navcontroller/80584/2 "2017-02-22T18:31:20Z")

</div>

Sounds like you are missing an import somewhere for NavController:

`import { NavController } from 'ionic-angular';`

If you post more of your code where the error is occurring we could be more helpful.

---

<div class="post-metadata">

**Author:** ![imenou](https://avatars.discourse-cdn.com/v4/letter/i/49beb7/32.png) [@imenou](https://forum.ionicframework.com/u/imenou)\
**Post date:** [February 22, 2017, 6:42pm UTC](https://forum.ionicframework.com/t/error-in-0-0-caused-by-no-provider-for-navcontroller/80584/3 "2017-02-22T18:42:16Z")

</div>

thx for your reply  
My purpose is to pass the data of a connected user from the loginService to the sideMenu, which is actually in the app.html, so because I’m little bit new with ionic2 and I don’t have many ideas about him haul arcitecture. So I inject a service in /app/app.component.ts and I tried to retrieve the user picture  
@Component({  
templateUrl: ‘app.html’,  
providers:[SocketService, LoginService]

```
})
export class MyApp {
  @ViewChild(Nav) nav: Nav;
  user: any;
  rootPage: any=Login;

  pages: Array<{title: string, component: any}>;

  constructor(public platform: Platform, public socket: SocketService, public _loginService: LoginService) {
   
    this.user=_loginService.getUser();
    alert(this.user);
```

---

<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:** [February 22, 2017, 9:25pm UTC](https://forum.ionicframework.com/t/error-in-0-0-caused-by-no-provider-for-navcontroller/80584/4 "2017-02-22T21:25:44Z")

</div>

Unless you’re absolutely sure of what you’re doing and why, don’t declare providers in components, only in the app module.

---

<div class="post-metadata">

**Author:** ![plmetz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/plmetz/32/106847_2.png) [@plmetz](https://forum.ionicframework.com/u/plmetz)\
**Post date:** [February 23, 2017, 7:38pm UTC](https://forum.ionicframework.com/t/error-in-0-0-caused-by-no-provider-for-navcontroller/80584/5 "2017-02-23T19:38:25Z")

</div>

@rapropos is right. You should also take a look at the [conference app example](https://github.com/driftyco/ionic-conference-app). I believe they do something similar to what you are attempting to do. If you still need more help you’d need to post more of your code.
