# No provider for Http! error in ionic

**URL:** <https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762>\
**Category:** ionic-v3\
**Created:** [April 7, 2017, 2:05pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762 "2017-04-07T14:05:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![riteshbhat17](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@riteshbhat17](https://forum.ionicframework.com/u/riteshbhat17)\
**Post date:** [April 7, 2017, 2:05pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/1 "2017-04-07T14:05:34Z")

</div>

full error:

> Runtime Error  
> Uncaught (in promise): Error: No provider for Http! Error at g ([http://localhost:8100/build/polyfills.js:3:7133](http://localhost:8100/build/polyfills.js:3:7133)) at injectionError ([http://localhost:8100/build/main.js:1511:86](http://localhost:8100/build/main.js:1511:86)) at noProviderError ([http://localhost:8100/build/main.js:1549:12](http://localhost:8100/build/main.js:1549:12)) at ReflectiveInjector\_._throwOrNull ([http://localhost:8100/build/main.js:3051:19](http://localhost:8100/build/main.js:3051:19)) at ReflectiveInjector_._getByKeyDefault ([http://localhost:8100/build/main.js:3090:25](http://localhost:8100/build/main.js:3090:25)) at ReflectiveInjector_._getByKey ([http://localhost:8100/build/main.js:3022:25](http://localhost:8100/build/main.js:3022:25)) at ReflectiveInjector_.get ([http://localhost:8100/build/main.js:2891:21](http://localhost:8100/build/main.js:2891:21)) at AppModuleInjector.get (ng:///AppModule/module.ngfactory.js:272:103) at AppModuleInjector.getInternal (ng:///AppModule/module.ngfactory.js:505:51) at AppModuleInjector.NgModuleInjector.get ([http://localhost:8100/build/main.js:3855:44](http://localhost:8100/build/main.js:3855:44)) at resolveDep ([http://localhost:8100/build/main.js:11260:45](http://localhost:8100/build/main.js:11260:45)) at createClass ([http://localhost:8100/build/main.js:11128:32](http://localhost:8100/build/main.js:11128:32)) at createDirectiveInstance ([http://localhost:8100/build/main.js:10954:37](http://localhost:8100/build/main.js:10954:37)) at createViewNodes ([http://localhost:8100/build/main.js:12303:49](http://localhost:8100/build/main.js:12303:49)) at createRootView ([http://localhost:8100/build/main.js:12208:5](http://localhost:8100/build/main.js:12208:5))

This is happening when i try to implement services i.e provider.

can anyone help real quick?

---

<div class="post-metadata">

**Author:** ![joshmorony](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/joshmorony/32/117695_2.png) [@joshmorony](https://forum.ionicframework.com/u/joshmorony)\
**Post date:** [April 7, 2017, 2:24pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/2 "2017-04-07T14:24:04Z")

</div>

Providers have **Http** included by default, and in order to use **Http** in your app you will need to add the **HttpModule** to your **app.module.ts** :

```auto
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ErrorHandler } from '@angular/core';
import { HttpModule } from '@angular/http';
...
  imports: [
    BrowserModule,
    HttpModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot()
  ],
...

```

---

<div class="post-metadata">

**Author:** ![riteshbhat17](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@riteshbhat17](https://forum.ionicframework.com/u/riteshbhat17)\
**Post date:** [April 9, 2017, 10:09am UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/4 "2017-04-09T10:09:05Z")

</div>

the issue with my code was i was import http in my provider file which was not at all reuired in my app so i removed the import…and it solved the issue.

And if you are using import http…then you should import HttpModule in the app.module.ts it will solve the issue.

```
import { HttpModule } from '@angular/http'; 
....
imports:[..., HttpModule],..
```

---

<div class="post-metadata">

**Author:** ![khaledelsafy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/khaledelsafy/32/107478_2.png) [@khaledelsafy](https://forum.ionicframework.com/u/khaledelsafy)\
**Post date:** [April 10, 2017, 7:30pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/5 "2017-04-10T19:30:55Z")

</div>

Many thanking for you joshmorony 🙂

---

<div class="post-metadata">

**Author:** ![uhelliton](https://avatars.discourse-cdn.com/v4/letter/u/9fc29f/32.png) [@uhelliton](https://forum.ionicframework.com/u/uhelliton)\
**Post date:** [April 11, 2017, 2:27am UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/6 "2017-04-11T02:27:42Z")

</div>

Thanks You @joshmorony

---

<div class="post-metadata">

**Author:** ![MASG](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/masg/32/102991_2.png) [@MASG](https://forum.ionicframework.com/u/MASG)\
**Post date:** [April 11, 2017, 2:35am UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/7 "2017-04-11T02:35:33Z")

</div>

thaaaannnnkkksssss 😁

---

<div class="post-metadata">

**Author:** ![KzellyKill](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@KzellyKill](https://forum.ionicframework.com/u/KzellyKill)\
**Post date:** [April 11, 2017, 1:09pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/8 "2017-04-11T13:09:37Z")

</div>

Gracias me sirvió mucho!

---

<div class="post-metadata">

**Author:** ![LeonidLyalin](https://avatars.discourse-cdn.com/v4/letter/l/e0b2c6/32.png) [@LeonidLyalin](https://forum.ionicframework.com/u/LeonidLyalin)\
**Post date:** [April 13, 2017, 9:54pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/9 "2017-04-13T21:54:17Z")

</div>

In Your youtube video "Loading Remote JSON DATA with HTTP in IONIC 2 no HttpModule in imports in app.module.ts: …

---

<div class="post-metadata">

**Author:** ![SatyaBhai](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@SatyaBhai](https://forum.ionicframework.com/u/SatyaBhai)\
**Post date:** [April 18, 2017, 12:20pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/10 "2017-04-18T12:20:52Z")

</div>

thanks bro…  
thank q sooooo much…

---

<div class="post-metadata">

**Author:** ![manav\_mehra](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@manav\_mehra](https://forum.ionicframework.com/u/manav_mehra)\
**Post date:** [May 2, 2017, 1:47pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/11 "2017-05-02T13:47:42Z")

</div>

Even after changing the import in app.module.ts I still receive the error. 😕

@riteshbhat17

---

<div class="post-metadata">

**Author:** ![riteshbhat17](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@riteshbhat17](https://forum.ionicframework.com/u/riteshbhat17)\
**Post date:** [May 2, 2017, 5:18pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/12 "2017-05-02T17:18:19Z")

</div>

can you provide the code which use have for the provider and app.module.ts here…

---

<div class="post-metadata">

**Author:** ![LoLStats](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lolstats/32/103165_2.png) [@LoLStats](https://forum.ionicframework.com/u/LoLStats)\
**Post date:** [May 2, 2017, 5:26pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/13 "2017-05-02T17:26:08Z")

</div>

Do you run Ionic 2.0 or 3.0?

---

<div class="post-metadata">

**Author:** ![manav\_mehra](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@manav\_mehra](https://forum.ionicframework.com/u/manav_mehra)\
**Post date:** [May 2, 2017, 5:32pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/14 "2017-05-02T17:32:20Z")

</div>

@riteshbhat17 Sure…

> [@Error in Http Module](https://forum.ionicframework.com/t/error-in-http-module/88604):
>
> I tried building the ionic app and I recieve the following error. [19:18:57] typescript: C:/Users/MANAV/ionreddit/src/app/services/reddit.service .ts, line: 11 Cannot find name 'Http'. L11: constructor(http:Http){ I did change the import {HttpModule} from ‘@angular/http’ in app.module.ts and added HttpModule in import: […] Can anyone help please confused

---

<div class="post-metadata">

**Author:** ![LoLStats](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lolstats/32/103165_2.png) [@LoLStats](https://forum.ionicframework.com/u/LoLStats)\
**Post date:** [May 2, 2017, 5:35pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/15 "2017-05-02T17:35:36Z")

</div>

Yor app.module.ts should look like this in Ionic 3.X

```auto
...
import { HttpModule } from '@angular/http';

...
imports: [
  BrowserModule,
  HttpModule,
  IonicModule.forRoot(MyApp)
],

```

And then you can import the Http Module in your provider

```auto
import { Http } from '@angular/http';
....
constructor(private http: Http) { }

```

You can follow my Ionic 3 guide here: [Guide: How to update to Ionic 3.X](https://forum.ionicframework.com/t/guide-how-to-update-to-ionic-3-x/87516)

---

<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:** [May 2, 2017, 8:57pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/16 "2017-05-02T20:57:09Z")

</div>

> [@LoLStats](#):
>
> app. **component**.ts should look like

Component? Not module?

---

<div class="post-metadata">

**Author:** ![LoLStats](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lolstats/32/103165_2.png) [@LoLStats](https://forum.ionicframework.com/u/LoLStats)\
**Post date:** [May 2, 2017, 9:01pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/17 "2017-05-02T21:01:26Z")

</div>

Ups 😮 I changed it

---

<div class="post-metadata">

**Author:** ![anil\_thummar07](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@anil\_thummar07](https://forum.ionicframework.com/u/anil_thummar07)\
**Post date:** [May 11, 2017, 12:36pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/18 "2017-05-11T12:36:25Z")

</div>

Thanks You @joshmorony,

**It’s work perfectly after added**

**import { HttpModule } from ‘@angular/http’;**

and

**imports: [**  
\*\* BrowserModule,\*\*  
\*\* HttpModule,\*\*  
\*\* IonicModule.forRoot(MyApp),\*\*  
\*\* IonicStorageModule.forRoot()\*\*  
\*\* ],\*\*

---

<div class="post-metadata">

**Author:** ![anshul24mehta](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/anshul24mehta/32/109663_2.png) [@anshul24mehta](https://forum.ionicframework.com/u/anshul24mehta)\
**Post date:** [May 20, 2017, 5:52pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/19 "2017-05-20T17:52:23Z")

</div>

thanks for your solution, but after including httpModule am getting below error

> Error: Encountered undefined provider! Usually this means you have a circular dependencies (might be caused by using ‘barrel’ index.ts files.

Please help me

---

<div class="post-metadata">

**Author:** ![Veloso](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/veloso/32/109966_2.png) [@Veloso](https://forum.ionicframework.com/u/Veloso)\
**Post date:** [May 29, 2017, 11:51pm UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/20 "2017-05-29T23:51:40Z")

</div>

Thanks, man, you saved my day!

---

<div class="post-metadata">

**Author:** ![deoprog](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@deoprog](https://forum.ionicframework.com/u/deoprog)\
**Post date:** [June 13, 2017, 1:34am UTC](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762/21 "2017-06-13T01:34:42Z")

</div>

Very Good! Congratulations, all likes the your posts.

[Next page](https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762.md?page=2)
