Skip to content
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

V5 not loading middleware when using middleware { mount: true }} #205

Open
thaoula opened this issue Jan 25, 2025 · 2 comments
Open

V5 not loading middleware when using middleware { mount: true }} #205

thaoula opened this issue Jan 25, 2025 · 2 comments
Labels
bug Something isn't working investigation Why is this happening? needs info Waiting for more information from the OP stale The solution hasn't moved forward in a while

Comments

@thaoula
Copy link

thaoula commented Jan 25, 2025

Hi Team,

Just upgraded our application to to NestJS v11 and nestjs-cls to V5.

It seems using this config no longer enables the cls middleware and you cannot get the request with .get(CLS_REQ).

      ClsModule.forRoot({
            global: true,
            middleware: {
                mount: true
            }
        }),

If I load the middleware manually using -

        consumer
            .apply(NoCacheMiddleware).forRoutes('/')
            .apply(ClsMiddleware).forRoutes('/').  

Everything works as before.

Is this a known issue or I am missing something after upgrading?

Kind Regards,
Tarek

@Papooch Papooch added bug Something isn't working investigation Why is this happening? labels Jan 27, 2025
@Papooch
Copy link
Owner

Papooch commented Jan 27, 2025

Hi, thank you for the report, are you using Express or Fastify? I just discovered some problems with Fastify + global prefix, which I'm going to address shortly.

If the problem is with Express, I'll need some more context to investigate.

@Papooch
Copy link
Owner

Papooch commented Jan 31, 2025

If you still encounter this issue, please upgrade @nestjs/core (and friends) to 11.0.6 and nestjs-cls to 5.0.1.

If the issue is still present, please create a minimal reproduction, so I can investigate.

@Papooch Papooch added needs info Waiting for more information from the OP stale The solution hasn't moved forward in a while labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigation Why is this happening? needs info Waiting for more information from the OP stale The solution hasn't moved forward in a while
Projects
None yet
Development

No branches or pull requests

2 participants