can't set headers after they are sent
 发布于 12 年前  作者 nodem  13686 次预览  最后一次回复是 8 年前  来自  

新手求助:Error:can’t set headers after they are sent 浏览器只能浏览一次,再刷新或者跳转都会出现无法访问。。。求助

3 回复
hexie

常见错误,估计是 你,你连续两次对外发送数据了,检查一下 逻辑,是否连续 使用了 res.send 之类的动作, 如果是跳转 记得 写成 return res.redirect()

cuing

刚遇到这个问题,原因是调用两次回调函数。最内层调用后,外层又用了一次。

995270418L

@cuing 那你是怎么解决的呢?