Can't use mutable header APIs after sent
Problem
Searched through the issues and found another (555) about this, but I am experiencing a completely different error with the 2.0 beta, perhaps related to interaction with Mongoose. I have an asynchronous call to to Mongoose's find() method to load a bunch of User objects. Inside the callback I am calling render on the response and then send the list of users to the view. This works fine when visiting the page for the first time. However, on any subsequent visit to the URL, node crashes with an error. The stack trace and relevant code snippet are shown in this gist: https://gist.github.com/856844
Error Output
error with the 2.0 beta, perhaps related to interaction with Mongoose. I have an asynchronous call to to Mongoose's find() method to load a bunch of User objects. Inside the callback I am calling render on
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Can't use mutable header APIs after sent
and that render call is the only thing end()ing in that route? will try and reproduce this on monday
Trust Score
1 verification
- 1
and that render call is the only thing end()ing in that route? will try and repr
and that render call is the only thing end()ing in that route? will try and reproduce this on monday
Validation
Resolved in expressjs/express GitHub issue #561. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep