-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
fastify-request-context is not working for POST API calls #236
Comments
Can anyone please help me with this, I am stuck because of this. |
I'm writing on SO 💯 Till now: I can't replicate |
https://github.com/rahul2123/fastify-server |
|
@rahul2123 could provide information about the versions? (fastify, fastify-request-context, nodejs) |
For what I saw, it is related to the cc @kibertoad |
Thanks! I'll investigate. |
@RafaelGSS here the information that is needed
|
@rahul2123 Please take a look at fastify/fastify-request-context#12. I believe it reproduces the way you use it more or less faithfully, and still works. Note that minimum supported Node version is 10.16.0, so maybe you could try with a slightly newer Node version and see if that helps? That wouldn't explain why 12.18.3 is not working for you, though, as it is exactly the same version that works in CI. |
@rahul2123 OK, I managed to reproduce that after adding end-to-end test without light-my-request. Will investigate further. |
@rahul2123 Basically the problem was that async storage was initialized too late in the lifecycle, and it was impossible to do so earlier. Added configuration option that should resolve your problem. Please review fastify/fastify-request-context#12 |
@rahul2123 Please try 2.0.1, it should work as expected with no changes on your end. |
This is my fastify server written in typescript while using the fastify-request-context plugin I am able to access the context of fastify request when I am requesting the resource using the GET method, But I am not able to access the context of fastify request if I am requesting the resource using POST method
This is the stackoverflow link
https://stackoverflow.com/questions/63325150/fastify-request-context-is-not-working-for-post-api-calls
The text was updated successfully, but these errors were encountered: