从前慢183的博客 }) 我在验证用户名是否被占用的时候,么有把下面用来测试的res.send('reguser ok')给注释掉,以至于造成res.send()重复调用,才造成:Cannot setheaders after they are sent to the client。错误 //res.send('...
凉菜凉凉的博客express 中间件中 next() 并不会阻断后面代码执行,如果后面继续对res的操作或者返回 就会导致 第二次响应,即下边的错误。...@Error[ERR_HTTP_HEADERS_SENT]:Cannot setheaders after they are sent to the client
zhenwei zhao的博客[ERR_HTTP_HEADERS_SENT]: Cannot setheaders after they are sent to the client 这个问题是服务端重复响应照成的,例如: db.query(sqlStr,userinfo.username,(err, result) => { if (err) { res.send({ ...