Unknown error, the response body from fetch is: undefined
See original GitHub issueI am using in Node.js the following versions “amazon-cognito-identity-js”: “^2.0.29”, “node-fetch”: “^2.2.0”,
I am trying to signUp and authenticateUser in my app.
Initially I was getting “fetch undefined” when I call singUp. Which was fixed by adding the node-fetch library. Now I can successfully signUp users.
Now I am getting the error “Unknown error, the response body from fetch is: undefined” when I call authenticateUser method. The code is as following.
`app.post(‘/login’, (req, res) => { var authenticationData = { Username: req.body.email, Password: req.body.password, };
var authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails(authenticationData);
var userData = {
Username: req.body.email,
Pool: userPool
};
var cognitoUser = new AmazonCognitoIdentity.CognitoUser(userData);
cognitoUser.authenticateUser(authenticationDetails, {
onSuccess: function (result) {
var accessToken = result.getAccessToken().getJwtToken();
/* Use the idToken for Logins Map when Federating User Pools with identity pools or when passing through an Authorization Header to an API Gateway Authorizer*/
var idToken = result.idToken.jwtToken;
},
onFailure: function (err) {
console.log(err);
}
});`
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Unknown error, the response body from fetch is undefined
The problem is that i get an error: Unknown error, the response body from fetch is undefined. I already have node-fetch on the...
Read more >Error and Warning Dictionary | Twilio
Below is a full list of all possible Twilio REST API error codes. Read our guidance on debugging your Twilio application for general...
Read more >HTTP status and error codes for JSON | Cloud Storage
Error responses usually include a JSON document in the response body, which contains information about the error. The following examples show some common...
Read more >fetch() - Web APIs | MDN
A fetch() promise only rejects when a network error is encountered ... method is 'GET' or 'HEAD' and the body is non-null or...
Read more >How to Fix "Error 520: Web Server Is Returning an Unknown ...
This problem occurs when your site lacks an HTTP status code or response body. To resolve it, make sure your DNS settings are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I removed the remember device and set it to no. It worked.
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels or Discussions for those types of questions.