I have an Ionic app that has a user provider with a signup() method:
doSignup() {
// set
I did face this issue and in my case responseType suppose to be text (because of designed API end-point) rather than default json.
import { HttpClient } from '@angular/common/http';
Before:
getToken(tokenCommand) {
return this.http.post(API_BASE_URL + 'user/token', tokenCommand);
}
After fixed:
getToken(tokenCommand) {
return this.http.post(API_BASE_URL + 'user/token', tokenCommand
, { responseType: 'text' });
}
I think this error message is too general and it will be nice if it's developers could provide more detail/helpful error message. Thanks.