It was an issue with global dependencies conflicting with local ones, as well as the old build (set to incremental mode) conflicting with the new property generation. Did the following to resolve the issue:

  • If nest cli is globally installed, manually upgrade it: yarn global upgrade upgrade @nestjs/cli, or with npm (npm update -g @nestjs/cli)
  • Upgrade local service nest to most recent version: nest update
  • Add the following to your nest-cli.json:
  "compilerOptions": {
    "plugins": ["@nestjs/swagger/plugin"]
  }
  • Remove your local dist folder (or do a yarn build)
  • Start the server with the nest cli commands (i.e. nest start or nest start:dev)
Answer from coler-j on Stack Overflow
Discussions

Jenkins says: @nestjs/swagger/plugin" plugin could not be found!
[ ] Regression [x] Bug report [ ... issue or request [ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow. With Nest.js i'm using @nestjs/swagger plugin. all works well on dev. in jekins, i'm pulling the code, and doing a build. For that, i have installed nest cli on ... More on github.com
🌐 github.com
3
May 21, 2020
Error The "@nestjs/swagger" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" nor "afterDeclarations()" function have been provided.
Is there an existing issue for this? I have searched the existing issues Current behavior When using pnpm within the Docker image, I am getting this error: Error The "@nestjs/swagger" plu... More on github.com
🌐 github.com
5
November 25, 2022
nestjs - Nest/swagger not found - Stack Overflow
Error "@nestjs/swagger/plugin" plugin could not be found! Have this error while starting my nestjs project. I don't know what am getting wrong. nestjs/swagger package is installed. More on stackoverflow.com
🌐 stackoverflow.com
nest-cli @nestjs/swagger plugin don't work - Stack Overflow
The "@nestjs/swagger": "^5.2.0", CLI Plugin isn't annotating all dtos and schemas classes . More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › nestjs › nest › issues › 10694
Build fails with the message, 'Error The "@nestjs/swagger" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" nor "afterDeclarations()" function have been provided. · Issue #10694 · nestjs/nest
December 12, 2022 - get an error when trying to build nest app with swagger on it as a plugin but first you need to omit dev-dependencies i saw issue #9650 and its pretty much the same · his solution was to change the node env to development from production but when we set it to production, the default behavior for npm is to not install dev-dependencies and when we set it to something other then that the dev-dependencies will be install by npm
Author   nestjs
🌐
npm
npmjs.com › package › @nestjs › swagger
nestjs/swagger
2 weeks ago - Nest - modern, fast, powerful node.js web framework (@swagger). Latest version: 11.4.6, last published: 10 days ago. Start using @nestjs/swagger in your project by running `npm i @nestjs/swagger`. There are 2486 other projects in the npm registry using @nestjs/swagger.
      » npm install @nestjs/swagger
    
Published   Jul 17, 2026
Version   11.4.6
🌐
GitHub
github.com › nestjs › swagger › issues › 763
Jenkins says: @nestjs/swagger/plugin" plugin could not be found! · Issue #763 · nestjs/swagger
May 21, 2020 - here is my dependency part of package.json, in case it is a matter of versions: "dependencies": { "@nestjs/common": "^7.0.0", "@nestjs/config": "^0.4.2", "@nestjs/core": "^7.0.0", "@nestjs/mongoose": "^6.4.0", "@nestjs/passport": "^7.0.0", "@nestjs/platform-express": "^7.0.0", "@nestjs/schedule": "^0.3.0", "@nestjs/swagger": "^4.5.7", "bcrypt": "^4.0.1", "class-transformer": "0.2.3", "class-validator": "0.12.2", "csurf": "^1.11.0", "dotenv": "^8.2.0", "express-rate-limit": "^5.1.3", "faker": "^4.1.0", "helmet": "^3.22.0", "mongoose": "^5.9.4", "passport": "^0.4.1", "passport-jwt": "^4.0.0", "reflect-metadata": "^0.1.13", "rimraf": "^3.0.2", "rxjs": "^6.5.4", "swagger-ui-express": "^4.1.4" }, Nest version: ^7.0.0 For Tooling issues: - Node version: 9.11.2 - Platform: Linux ubuntu 17 Others:
Author   nestjs
🌐
GitHub
github.com › nestjs › nest-cli › issues › 1836
Error The "@nestjs/swagger" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" nor "afterDeclarations()" function have been provided. · Issue #1836 · nestjs/nest-cli
November 25, 2022 - Error The "@nestjs/swagger" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" nor "afterDeclarations()" function have been provided. This problem was also mentioned here nestjs/nest#9650 by @piosystems. SOLUTION: Once I removed the compilerOptions from the nest-cli.json file, I got it working. ... # ... RUN pnpm fetch RUN pnpm install -r --frozen-lockfile --offline --filter '...' RUN pnpm --filter '...' build #...
Author   nestjs
🌐
npm
npmjs.com › package › typescript-nestjs-swagger-plugin
typescript-nestjs-swagger-plugin - npm
Add this plugin to tsconfig.json.
      » npm install typescript-nestjs-swagger-plugin
    
Published   Jun 28, 2023
Version   2.0.0
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 73511386 › nest-swagger-not-found
nestjs - Nest/swagger not found - Stack Overflow
Error "@nestjs/swagger/plugin" plugin could not be found! Have this error while starting my nestjs project. I don't know what am getting wrong. nestjs/swagger package is installed.
🌐
Lightrun
lightrun.com › answers › nestjs-nest-build-fails-with-the-message-error-the-nestjsswagger-plugin-is-not-compatible-with-nest-cli-n
Build fails with the message, 'Error The "@nestjs/swagger" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" nor "afterDeclarations()" function have been provided.
get an error when trying to build nest app with swagger on it as a plugin but first you need to omit dev-dependencies i saw issue https://github.com/nestjs/nest/issues/9650 and its pretty much the same · his solution was to change the node env to development from production but when we set it to production, the default behavior for npm is to not install dev-dependencies and when we set it to something other then that the dev-dependencies will be install by npm
🌐
GitHub
github.com › nestjs › nest › issues › 9429
The "@nestjs/swagger" plugin is not compatible with Nest CLI. · Issue #9429 · nestjs/nest
April 2, 2022 - Is there an existing issue for this? I have searched the existing issues Current behavior npm run start:dev Error The "@nestjs/swagger" plugin is not compatible with Nest CLI. Neither &qu...
Author   nestjs
🌐
DEV Community
dev.to › ipreda › nx-nestjs-how-to-autogenerate-openapiswagger-specs-518n
Nx NestJs - How to autogenerate OpenApi/Swagger specs - DEV Community
May 9, 2022 - As I started using NestJs with Nx I noticed a point of contingency, there are still debates on how to activate OpenApi/Swagger in NestJs with the auto documentation option. Fear no more, at the end of this tutorial that problem will be solved. I am using the latest Nx at the time of writing, which is V14, with NestJs 8.0 and NestJs Swagger 5.2. Install the required package first, if you use express install npm install --save @nestjs/swagger swagger-ui-express otherwise, for fastify use npm install --save @nestjs/swagger fastify-swagger
🌐
GitHub
github.com › nestjs › swagger › issues › 405
Plugin error · Issue #405 · nestjs/swagger
December 4, 2019 - [ ] Regression [X] Bug report [ ] Feature request [X] Documentation issue or request [ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow. I tried install swagger 4.0.1 and try it.But i got error · nest start Error "@nestjs/swagger/plugin" ...
Author   nestjs
🌐
NestJS
docs.nestjs.com › openapi › cli-plugin
CLI Plugin - OpenAPI | NestJS - A progressive Node.js ...
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
🌐
GitHub
github.com › nestjs › swagger › issues › 552
Plugin doesn't work without nest-cli · Issue #552 · nestjs/swagger
February 6, 2020 - I'm not sure if this is a bug or just a missing feature, but it definitely goes against expectations. Have the plugin work just as it would if used via nest-cli. See this repository: https://github.com/boenrobot/nestjs-issues/tree/master/swagger-plugin-ignored
Author   nestjs
🌐
GitHub
github.com › nestjs › swagger › issues › 558
nest-cli swagger plugin don't work · Issue #558 · nestjs/swagger
February 11, 2020 - my nest-cli.json: { "collection": "@nestjs/schematics", "sourceRoot": "src", "compilerOptions": { "plugins": [ "@nestjs/swagger/plugin" ] } }
Author   nestjs
🌐
Stack Overflow
stackoverflow.com › questions › tagged › nestjs-swagger
Recently Active 'nestjs-swagger' Questions - Stack Overflow
I am facing an issue with Swagger UI in my NestJS application where it's not sending the Authorization header with the requests. I have set up JWT authentication and when I test the endpoints using ... ... I design this main.ts file and need to test the controllers with Swagger. I start:dev and all the server works fine, but cannot access via localhost:3000/docs/ws to enter Swagger UI. Here is the code: ... ... i can't install swagger in my nestjs application.
🌐
Reddit
reddit.com › r/nestjs_framework › nestjs + swagger: any way to avoid writing everything manually for dtos + file upload?
r/Nestjs_framework on Reddit: NestJS + Swagger: Any way to avoid writing everything manually for DTOs + file upload?
June 19, 2025 -

Hey guys, do I have to write everything manually to integrate Swagger with NestJS?
For example, do I really need to add code like this in every DTO?
@ApiProperty({

description: 'Username (3-20 characters, letters, numbers, underscore only)',

example: 'john_doe123',

minLength: 3,

maxLength: 20,

})

and doing the same for the response of each end point

I found the Swagger CLI plugin and installed it. It works, but not as expected.
The problem:

  • My API endpoint receives a CreateUserDto body and a file.

  • The file validation is handled in the controller.

  • The request should be multipart/form-data, but Swagger still shows application/json, and there's no info about the file.

  • The CLI generates something, but not what I need.

Any advice? Or a good video that covers this exact use case (DTO + file upload) without doing everything manually?

🌐
GitHub
github.com › nrwl › nx › issues › 28836
NestJS Swagger Plugin with Shared Libs · Issue #28836 · nrwl/nx
November 7, 2024 - Thanks in advance · No error when using swagger plugin · No response · Create a nest preset workspace · Add angular, shared lib & a nest app with nx plugin · Install @nestjs/swagger and append swagger plugin to api's webpack config ·
Author   nrwl