Property 'text' does not exist on type 'Object' HttpClient


Today I’ve updated my project to Angular 5 and ionic 3.9.2 and my injectable service to manage http connections has stopped to work.

import {HttpClient} from “@angular/common/http”;

constructor(private http: HttpClient) {

return this.http.get(url)
.then(response => {

With HttpClient library(Http library is deprecated) the transpile shows this error

Property ‘json’ does not exist on type ‘Object’.

Other properties like .text(), .headers also not work

If I change HttpClient to Http all works properly

What I’m doing wrong?

1 Like

look here the same problem with solution: