markbates / markbates/Programming-In-CoffeeScript

Non of the code runs in chapter 11 (Can't set headers after they are sent)

未关闭
#1 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
CoffeeScript
星标
62
派生
20
PR 合并指标
30 天内没有已合并 PR

描述

If you try running any code in chapter 11 you get the same error "Can't set headers after they are sent"

Express 3.0.0beta7
CoffeeScript version 1.3.3
Node v0.8.2

http.js:644
throw new Error('Can\'t set headers after they are sent.');
^
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:644:11)
at ServerResponse.res.setHeader (/Users/work/todo/node_modules/express/node_modules/connect/lib/patch.js:62:20)
at ServerResponse.res.header (/Users/work/todo/node_modules/express/lib/response.js:280:8)
at ServerResponse.res.json (/Users/work/todo/node_modules/express/lib/response.js:135:8)
at Create.global.Responder.Responder.complete (/Users/work/todo/src/controllers/responders/responder.js:27:25)
at Promise.__bind (/Users/work/todo/src/controllers/responders/responder.js:3:63)
at Promise.addBack (/Users/work/todo/node_modules/mongoose/lib/promise.js:120:8)
at Promise.EventEmitter.emit (events.js:88:17)
at Promise.emit (/Users/work/todo/node_modules/mongoose/lib/promise.js:59:38)
at Promise.complete (/Users/work/todo/node_modules/mongoose/lib/promise.js:70:20)

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先使用列出的 CoffeeScript、Express 和 Node 版本运行第 11 章中的一个示例,然后将报告的失败追踪到 src/controllers/responders/responder.js。将第 11 章的其他示例进行比较,以确定它们是否到达相同的 responder path;完成的标准是章节示例能够运行且不会出现报告的 headers error。

由索引模型根据 Issue 内容生成。

评估

技术栈
coffeescript, express, node.js
领域
backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。