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

WARN [LegacyRouteConverter] Unsupported route path: "/v1/(.*)". - With Fastify adapter #14568

Closed
6 of 15 tasks
rafael-wolf-cbh opened this issue Feb 4, 2025 · 7 comments
Closed
6 of 15 tasks
Labels
needs triage This issue has not been looked into

Comments

@rafael-wolf-cbh
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

likely tied to #14513

I am seeing the same warning, however I am using Fastify, not Express

Here is my setup:

app.setGlobalPrefix('v1');

export class AppModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer.apply(AuthMiddleware).forRoutes({
      path: '(.*)',
      method: RequestMethod.ALL,
    });
  }
}

Changing the path: '(.*)' to path: '{*path}' did not work

Thanks!

Minimum reproduction code

https://github.com/rafakwolf/nest-test

Steps to reproduce

yarn install
yarn start:dev

Expected behavior

I expect not see the warning message

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

No response

NestJS version

No response

Packages versions

❯ yarn list | grep @nest
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
│  ├─ @nestjs/bull-shared@^11.0.2
├─ @nestjs/[email protected]
│  ├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
│  ├─ @nestjs/[email protected]
├─ @nestjs/[email protected]
├─ @nestjs/[email protected]

Node.js version

v20.17.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@rafael-wolf-cbh rafael-wolf-cbh added the needs triage This issue has not been looked into label Feb 4, 2025
@kamilmysliwiec
Copy link
Member

What if you change it to *path (without {})?

@rafael-wolf-cbh
Copy link
Author

Hey @kamilmysliwiec thank you for the answer.

Same warning

export class AppModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer.apply(AuthMiddleware).forRoutes({
      path: '*path',
      method: RequestMethod.ALL,
    });
  }
}

Image

@kamilmysliwiec
Copy link
Member

Can't reproduce this issue with *path. Could you update the minimum reproduction repository?

Image

Image

@rafael-wolf-cbh
Copy link
Author

Yeah, it looks like something is "wrong" in my project, updating the minimum reproduction, the warning goes away

@rafael-wolf-cbh
Copy link
Author

rafael-wolf-cbh commented Feb 5, 2025

Found the issue, I added the packages nestjs-pino + pino-http, for logging

I added it, like so:

    LoggerModule.forRootAsync({
      useFactory: async () => {
        return {
          pinoHttp: {
            level: 'info',
            genReqId: (request) => request.headers['x-correlation-id'] || '123456789',
            transport: { target: 'pino-pretty' },
          },
        };
      },
    }),

Likely it is still not compatible with nestjs 11.

@kamilmysliwiec feel free to close the issue

Thank you!

@rafael-wolf-cbh
Copy link
Author

Isn't it related to this? iamolegga/nestjs-pino#1849

@kamilmysliwiec
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

No branches or pull requests

2 participants