Skip to content

fix "Error: Can't set headers after they are sent." express error #12

Open

Description

@ndcampbell

Not sure what is causing this....Express throws this error on any POST though it still completes the transaction and does not kill the process. Full stack:

Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:344:11)
    at ServerResponse.header (/Users/dcampbell/personal/ex-post-facto/app/node_modules/express/lib/response.js:719:10)
    at ServerResponse.send (/Users/dcampbell/personal/ex-post-facto/app/node_modules/express/lib/response.js:164:12)
    at /Users/dcampbell/personal/ex-post-facto/app/app.js:44:23
    at Layer.handle [as handle_request] (/Users/dcampbell/personal/ex-post-facto/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/dcampbell/personal/ex-post-facto/app/node_modules/express/lib/router/route.js:131:13)
    at Route.dispatch (/Users/dcampbell/personal/ex-post-facto/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/dcampbell/personal/ex-post-facto/app/node_modules/express/lib/router/layer.js:95:5)
    at /Users/dcampbell/personal/ex-post-facto/app/node_modules/express/lib/router/index.js:277:22
    at Function.process_params (/Users/dcampbell/personal/ex-post-facto/app/node_modules/express/lib/router/index.js:330:12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions