Here is my configuration
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { DocumentBuilder, SwaggerModule} from "@nestjs/swagger";
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const config = new DocumentBuilder().setTitle("DNXT API")
.setDescription("The DNXT api is De generation next api")
.setVersion("1.0.0").build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup("/", app, document);
await app.listen(3000);
}
bootstrap();
while trying to run the app, i get the error below
(node:1612) UnhandledPromiseRejectionWarning: TypeError: shared_utils_1.validatePath is
not a function
at SwaggerExplorer.validateRoutePath (C:\Users\HP\Desktop\DNXT\nest-
ncc\node_modules\@nestjs\swagger\dist\swagger-explorer.js:135:61)
at SwaggerExplorer.generateDenormalizedDocument (C:\Users\HP\Desktop\DNXT\nest-
ncc\node_modules\@nestjs\swagger\dist\swagger-explorer.js:53:25)
at SwaggerExplorer.exploreController (C:\Users\HP\Desktop\DNXT\nest-
ncc\node_modules\@nestjs\swagger\dist\swagger-explorer.js:47:21)
at C:\Users\HP\Desktop\DNXT\nest-ncc\node_modules\@nestjs\swagger\dist\swagger-
scanner.js:48:84
at Array.map (<anonymous>)
at SwaggerScanner.scanModuleRoutes (C:\Users\HP\Desktop\DNXT\nest-
ncc\node_modules\@nestjs\swagger\dist\swagger-scanner.js:48:56)
at C:\Users\HP\Desktop\DNXT\nest-ncc\node_modules\@nestjs\swagger\dist\swagger-
scanner.js:39:25
at Array.map (<anonymous>)
at SwaggerScanner.scanApplication (C:\Users\HP\Desktop\DNXT\nest-
ncc\node_modules\@nestjs\swagger\dist\swagger-scanner.js:25:43)
at Function.createDocument (C:\Users\HP\Desktop\DNXT\nest-
ncc\node_modules\@nestjs\swagger\dist\swagger-module.js:19:41)
(node:1612) UnhandledPromiseRejectionWarning:
Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the