-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Unsupported route path warning produced from app.setGlobalPrefix() #14513
Comments
I didn't manage to reproduce it here on Linux. import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule, {bufferLogs:true,rawBody:true});
app.setGlobalPrefix("/v1");
await app.listen(process.env.PORT || 3000);
}
bootstrap(); import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
@Module({
controllers: [AppController]
})
export class AppModule {} import { Controller, Get } from '@nestjs/common';
@Controller()
export class AppController {
@Get()
foo() {
return 1
}
} Please provide a minimum reproduction repository. You can start one by running why reproductions are required |
make sure you've read the migration guide I only got that warning when using |
In my case, I have something like this: configure(consumer: MiddlewareConsumer) {
consumer.apply(SomeMiddleware).forRoutes('*');
} So, |
Can you share any way that I can resolve this ?? Same issue I am gettting too many warning
|
I have the same problem as @0xHendrix when use app.setGlobalPrefix |
Just change |
Is there an existing issue for this?
Current behavior
Setting a global prefix in Nest.js 11 produces the following warning:
When I remove
app.setGlobalPrefix("/v1")
the warning goes away.Minimum reproduction code
N/A
Steps to reproduce
Include a global prefix in your main.ts file:
Expected behavior
No warnings appear from setting a global prefix
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 package
No response
NestJS version
11.0.5
Packages versions
[System Information]
OS Version : macOS24.3.0
NodeJS Version : v22.11.0
NPM Version : 10.9.0
[Nest CLI]
Nest CLI Version : 11.0.2
[Nest Platform Information
platform-express version : 11.0.5
microservices version : 11.0.5
schematics version : 11.0.0
passport version : 11.0.5
schedule version : 5.0.1
graphql version : 13.0.2
swagger version : 11.0.3
testing version : 11.0.5
apollo version : 13.0.2
common version : 11.0.5
config version : 4.0.0
axios version : 4.0.0
bull version : 11.0.1
core version : 11.0.5
cqrs version : 11.0.0
cli version : 11.0.2
Node.js version
22.11.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: