211085 (2) [Avatar] Offline
#1
Not sure how this is/should be addressed but added res-error

npm install res-error --save 


and added the the following after const app = express():

app.use(require('res-error'));


and it worked fine.
608140 (1) [Avatar] Offline
#2
I had the same problem. I followed what is suggested and then I encounter the following error when I try to send a void form:

POST /post 500 28.089 ms - 42
Error: Can't set headers after they are sent.
    at validateHeader (_http_outgoing.js:491:11)


the error appears while calling
res.redirect('back')


in the middleware.js in the required function