[오류모음] [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client


[오류모음] [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

Node.js express의 nodemailer 모듈을 이용하여 회원가입 OTP 인증을 구현하던 중 Unhandled rejection Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client 에러가 발생하였다.한 곳에 응답이 중복되게 들어가면 발생하는 오류이다. (너무 생각없이 짰다...)if문과 반복문에서 중복처리가 되어있을 경우에 주로 발생한다.위의 코드로 바꿔주어 해결하였다....

[오류모음] [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client에 대한 요약내용입니다.

자세한 내용은 아래에 원문링크를 확인해주시기 바랍니다.



원문링크 : [오류모음] [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client