Usually this problem is related with response sent from the backend
// Step 3 : send the email
transporter.sendMail(mailOption, (err,data) => {
if(err){
console.log("error :", err)
return res.status(404).json({message : 'Nodemailer Error'})
}else{
console.log("Email sent complete")
return res.status(200).json({ message : 'success', email : PswEmail})
}
})
return res.status(200).json({ message : 'success', email : PswEmail})
Autaully, there was no 'PswEmail' in the backend code,
that is, server is sending no-existing info,
So even if, the request from the frontend using the fetch api succeed, the response is not valid from the backend, and response is not handled properly in the frontend