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

Open
#1 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
coffeescript, express, node.js
Domain
backend

Research direction

Start by running one of the chapter 11 examples with the listed CoffeeScript, Express, and Node versions, then trace the reported failure into src/controllers/responders/responder.js. Compare the other chapter 11 examples to determine whether they reach the same responder path; done means the chapter examples run without the reported headers error.

Written by the indexing model from the issue text.

Description

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)

Dominant language
CoffeeScript
Stars
62
Forks
20
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from markbates/Programming-In-CoffeeScript

All issues in markbates/Programming-In-CoffeeScript

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.