-
Notifications
You must be signed in to change notification settings - Fork 32
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
Global middleware not running on Nest > 10.3.2 (fastify, global prefix) #134
Comments
Thanks for reporting, I'll look into it. Let me ask you some clarifying questions:
|
Fastify, |
I suspect the "fix" in this NestJS release might be the cause. The |
I have investigated on my side, updated NestJS to Can I ask you for a minimal reproduction which shows the incorrect behavior? |
So the context gets initialized, but the setup function is not executed? That's beyond strange, execution of that code is controlled by ClsMiddleware, not Nest. I tested that yesterday on latest version of everything with a basic console log and it did work. Are you sure you only updated Nest and not other libraries that might interfere? Can you share a minimal repro of your issue. I am not sure I'd be able to help you otherwise. |
Sorry, I commented to hastily. I did some more testing, and for me, it turns out no middleware gets executed at all - not even a custom one that I add. I'll try to provide a reproduction repo but at the end of the day I don't think this is an issue with nestjs-cls at all. I might have some mismatched dependencies or something I'm not sure yet |
Make sure to also update |
Managed to boil it down to the exclude param of global prefix - opened an issue here nestjs/nest#13401 |
When upgrading nestjs from 10.3.2 to anything above that, my global middleware stops running.
Namely, this middleware:
No issues in any of the below versions. Using latest nestjs-cls 4.3.0
Any ideas?
The text was updated successfully, but these errors were encountered: