最終更新: hira_kosukety 2019年03月25日(月) 19:37:09履歴
web3 使ってコントラクトのファンクションを『send』処理したあとに
『UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1):
Error: Can't set headers after they are sent.』
がでる。
原因を調べてみると、各、".on()"の処理後に、
res.send("xxxx")
と終了処理していたが、これではきっちり処理が終了しないらしく、
return res.send("xxxx")
と書かないといけいない。
『UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1):
Error: Can't set headers after they are sent.』
がでる。
原因を調べてみると、各、".on()"の処理後に、
res.send("xxxx")
と終了処理していたが、これではきっちり処理が終了しないらしく、
return res.send("xxxx")
と書かないといけいない。
タグ
コメントをかく