Error TS4053: Return type of public method from exported class has or is using name 'Response' from external module "/node_modules/@angular/http/src/static_response" but cannot be named

Hi everyone,
I tried to update my project with Ionic2 RC0. I choose the way creating a new Ionic 2 project and copying my project files to it. What can I do to solve this ? The first line with error…

login(user:User) {
const data = JSON.stringify({u: user.username, p: user.password});
return this.http.post(this.actions.login, data)
}

I get the same error.

Hi guys, I resolved this problem adding:

import { Injectable} from ‘@angular/core’;
import { Http, Headers, Response } from ‘@angular/http’;
import { Observable } from "rxjs/Observable"
import ‘rxjs/add/operator/map’;

to my providers, i hope this will help!

1 Like