-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
option to manually flush/write body to browser when done #541
Comments
#148 seems to be reasonably well described - care is needed when using async await to make sure subsequent middleware aren’t executed before your promise resolves (including Oak’s default response if none is supplied). Do you have a more complete code example? |
As @cmorten says, a more complete code example would be needed to help, but this usually occurs when middleware is not holding onto the request in a way that indicates it is still processing, specifically not invoking or returning the |
I have so far been unable to sort out this issue. I have a code that uses the MongoDb driver and whenever a do a fetch operation, i can no longer write to .response.body, e.g:
Once I call -
await users.findOne({ email: req.email })
, I get an error when I doctx.response.body
.As a workaround, is there a way i can force write the response, or a flag i can use to force oak not to close the response until i explicitly tell it to?
The error I get:
The response is not writable.
The text was updated successfully, but these errors were encountered: