balupton/docpad — Issue #102: "Error: Can't set headers after they are sent." on dynamic pages
Author: balupton
Created: 2011-11-11 10:01:35+00:00
State: open
Labels: core, eventually, patches-welcome

```
Error: Can't set headers after they are sent.
at ServerResponse. (http.js:531:11)
at ServerResponse.setHeader (/Users/balupton/Dropbox/Projects/docpad/node_modules/express/node_modules/connect/lib/patch.js:62:20)
at next (/Users/balupton/Dropbox/Projects/docpad/node_modules/express/node_modules/connect/lib/http.js:169:13)
at /Users/balupton/Dropbox/Projects/docpad/lib/docpad.coffee:869:30
at /Users/balupton/Dropbox/Projects/docpad/lib/file.coffee:302:22
at Group.next (/Users/balupton/Dropbox/Projects/docpad/lib/file.coffee:307:18)
at Group.exit (/Users/balupton/Dropbox/Projects/docpad/node_modules/bal-util/lib/util.coffee:117:21)
at Group.complete (/Users/balupton/Dropbox/Projects/docpad/node_modules/bal-util/lib/util.coffee:98:25)
at /Users/balupton/Dropbox/Projects/docpad/lib/file.coffee:339:30
at Group.next (/Users/balupton/Dropbox/Projects/docpad/lib/docpad.coffee:387:16)
```

Been getting this a bit on dynamic pages, but have an incredibly hard time trying to figure out why - the code appears fine to me. Can someone else take this up? Cheers.