# Ocombe/ng2-translate Bug in Ionic Beta 7 - Argument of type 'Http' is not assignable to parameter of type 'Http' #132

**URL:** <https://forum.ionicframework.com/t/ocombe-ng2-translate-bug-in-ionic-beta-7-argument-of-type-http-is-not-assignable-to-parameter-of-type-http-132/53023>\
**Category:** ionic-v3\
**Created:** [May 26, 2016, 4:19am UTC](https://forum.ionicframework.com/t/ocombe-ng2-translate-bug-in-ionic-beta-7-argument-of-type-http-is-not-assignable-to-parameter-of-type-http-132/53023 "2016-05-26T04:19:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![saiy2k](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@saiy2k](https://forum.ionicframework.com/u/saiy2k)\
**Post date:** [May 26, 2016, 4:19am UTC](https://forum.ionicframework.com/t/ocombe-ng2-translate-bug-in-ionic-beta-7-argument-of-type-http-is-not-assignable-to-parameter-of-type-http-132/53023/1 "2016-05-26T04:19:14Z")

</div>

I integrated the ng2-translate and it was working cool in Beta 6. When I upgraded to Beta 7 this week, I am getting this error in Terminal on `ionic serve`

```
TypeScript error: app/app.ts(27,79): Error TS2345: Argument of type 'Http' is not assignable to parameter of type 'Http'.
  Property '_backend' is protected but type 'Http' is not a class derived from 'Http'.

useFactory : (http: Http) => new TranslateStaticLoader(http, 'assets/i18n', '.json'),:

```

In above line, error is thrown at the first http parameter passed to TranslateStaticLoader

Raised [an issue](https://github.com/ocombe/ng2-translate/issues/132) in their Github Repo too.

Would be great, If someone could give a quick fix, while I wait for the plugin author to provide a proper fix 🙂

---

<div class="post-metadata">

**Author:** ![Mobius77](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@Mobius77](https://forum.ionicframework.com/u/Mobius77)\
**Post date:** [May 26, 2016, 10:10am UTC](https://forum.ionicframework.com/t/ocombe-ng2-translate-bug-in-ionic-beta-7-argument-of-type-http-is-not-assignable-to-parameter-of-type-http-132/53023/2 "2016-05-26T10:10:59Z")

</div>

I assume when you upgraded ionic2 to beta7 you also updated ng2-translate to the latest version which works with Angular RC? ng2-translate version 2.1.0 is working for me.

---

<div class="post-metadata">

**Author:** ![mbakker1996](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mbakker1996/32/96698_2.png) [@mbakker1996](https://forum.ionicframework.com/u/mbakker1996)\
**Post date:** [May 26, 2016, 12:07pm UTC](https://forum.ionicframework.com/t/ocombe-ng2-translate-bug-in-ionic-beta-7-argument-of-type-http-is-not-assignable-to-parameter-of-type-http-132/53023/3 "2016-05-26T12:07:12Z")

</div>

This is how I have it:

```
providers: [provide(TranslateLoader, {
            useFactory: (http: Http): any => new TranslateStaticLoader(http, 'translate', '.json'),
            deps: [Http],
        }),
        TranslateService],
```

---

<div class="post-metadata">

**Author:** ![saiy2k](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@saiy2k](https://forum.ionicframework.com/u/saiy2k)\
**Post date:** [May 26, 2016, 12:27pm UTC](https://forum.ionicframework.com/t/ocombe-ng2-translate-bug-in-ionic-beta-7-argument-of-type-http-is-not-assignable-to-parameter-of-type-http-132/53023/4 "2016-05-26T12:27:15Z")

</div>

Wow. It worked. Thanks 🙂  
I was using some older version of ng2-translate How dumb of me!

---

<div class="post-metadata">

**Author:** ![ksnidalova](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@ksnidalova](https://forum.ionicframework.com/u/ksnidalova)\
**Post date:** [May 27, 2016, 6:57am UTC](https://forum.ionicframework.com/t/ocombe-ng2-translate-bug-in-ionic-beta-7-argument-of-type-http-is-not-assignable-to-parameter-of-type-http-132/53023/5 "2016-05-27T06:57:27Z")

</div>

I am getting same typescript error while including ng-2 translate providers in useFactory row while using ng2-translate version 2.1.0:

Argument of type ‘Http’ is not assignable to parameter of type ‘Http’.  
Property ‘\_backend’ is protected but type ‘Http’ is not a class derived from ‘Http’.

provide(TranslateLoader, {  
useFactory: (http: Http) =\> new TranslateStaticLoader(http, ‘assets/i18n’, ‘.json’),  
deps: [Http]  
}), TranslateService

package.json  
{  
“dependencies”: {  
"@angular/common": “2.0.0-rc.1”,  
"@angular/compiler": “2.0.0-rc.1”,  
"@angular/core": “2.0.0-rc.1”,  
"@angular/http": “2.0.0-rc.1”,  
"@angular/platform-browser": “2.0.0-rc.1”,  
"@angular/platform-browser-dynamic": “2.0.0-rc.1”,  
"@angular/router": “2.0.0-rc.1”,  
“ct-angular2-color-picker”: “1.0.0”,  
“es6-shim”: “^0.35.0”,  
“ionic-angular”: “^2.0.0-beta.7”,  
“ionic-native”: “^1.1.0”,  
“ionicons”: “3.0.0”,  
“ng2-translate”: “2.1.0”,  
“reflect-metadata”: “0.1.3”,  
“rxjs”: “5.0.0-beta.6”,  
“zone.js”: “0.6.12”  
},  
“devDependencies”: {  
“del”: “2.2.0”,  
“gulp”: “3.9.1”,  
“gulp-watch”: “4.3.5”,  
“ionic-gulp-browserify-typescript”: “^1.1.0”,  
“ionic-gulp-fonts-copy”: “^1.0.0”,  
“ionic-gulp-html-copy”: “^1.0.0”,  
“ionic-gulp-sass-build”: “^1.0.0”,  
“ionic-gulp-scripts-copy”: “^2.0.0”,  
“run-sequence”: “1.1.5”  
},  
“name”: “xxxx”,  
“description”: “xxxx: An Ionic project”,  
“cordovaPlugins”: [  
“cordova-plugin-device”,  
“cordova-plugin-console”,  
“cordova-plugin-whitelist”,  
“cordova-plugin-splashscreen”,  
“cordova-plugin-statusbar”,  
“ionic-plugin-keyboard”,  
“cordova plugin add cordova-plugin-x-toast”  
],  
“cordovaPlatforms”: []  
}

Any ideas?

---

<div class="post-metadata">

**Author:** ![mbakker1996](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mbakker1996/32/96698_2.png) [@mbakker1996](https://forum.ionicframework.com/u/mbakker1996)\
**Post date:** [June 17, 2016, 8:03am UTC](https://forum.ionicframework.com/t/ocombe-ng2-translate-bug-in-ionic-beta-7-argument-of-type-http-is-not-assignable-to-parameter-of-type-http-132/53023/6 "2016-06-17T08:03:06Z")

</div>

@ksnidalova I’ve this in my app.ts:

```
provide(TranslateLoader, {
   useFactory: (http: Http): any => new TranslateStaticLoader(http, 'translate', '.json'),
   deps: [Http],
}), TranslateService
```

---

<div class="post-metadata">

**Author:** ![ksnidalova](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@ksnidalova](https://forum.ionicframework.com/u/ksnidalova)\
**Post date:** [June 17, 2016, 8:35am UTC](https://forum.ionicframework.com/t/ocombe-ng2-translate-bug-in-ionic-beta-7-argument-of-type-http-is-not-assignable-to-parameter-of-type-http-132/53023/7 "2016-06-17T08:35:56Z")

</div>

I solved the problem by removing

> [@ksnidalova](#):
>
> “ct-angular2-color-picker”: “1.0.0”,

from my package.json file which didn’t work anyway. Then I deleted all node\_modules and ran npm install again. The error must have been caused by some dependency conflict, because it works okay now. Try to check for module conflicts.
