-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
body-parser and async are breaking CLS #4
Comments
Thanks for the feedback and thanks for the usage notes! Which versions of node have you been using |
node v6.10.2 |
@skonves I think you should add this to the readme. It could save many hours. |
🎉 I just spent an hour on this one too. Thanks for documenting it! Any idea why it's happening? Debugging through
|
Thanks for the feedback! What version of node are you running and what OS are you running on? FWIW, there is a known issue with how node 10 handles async/await (see issue #8). |
It looks like the bug linked in the readme has been marked closed, can httpContext be updated to work with node 10 now? |
Absolutely 👍 Node 10.4.0 and later include the fixed version of V8. |
context request lost when doing multiple API calls, but works if it is just one API call |
any update about that? seems to strange. I am using directly cls-hooked. |
Any update on this ... Any one? |
For those who were interested in the fix - the body-parser has a fix in 1.20:
https://github.com/expressjs/body-parser/blob/master/HISTORY.md Maybe it will help you |
This is the way 💯 . I just updated body-parser to latest 1.20.2 and the context is there. Event if the app.use(httpContext.middleware); is defined above app.use(bodyParser). EDIT I don't get it sometimes it's working sometimes not. Now i use 1.20.0 body-parser and app.use(httpContext.middleware); below app.use(body-parser). On Post it works sometimes on first api call sometimes only after second. But for GET it always work. I have sadly no time to debugging deeper |
To avoid weird behavior with express:
express-http-context
in the first row of your app. Some popular pkgs use async which breaks CLS.express-http-context
's middleware. I did after seeing that all post requests lost the context.The text was updated successfully, but these errors were encountered: