I have the swagger plugin enabled in my project and If i run the build command locally it completes without any problem, but when i try to deploy to both Heroku and Render i get this error from the plugin when the build command is triggered:
Heroku:
On Heroku, this is the command in Procfile:
web: pnpm run start:prod
Output log:
Build
Running build
> laboratorio_ferreira_api@0.0.1 prebuild
> rimraf dist
> laboratorio_ferreira_api@0.0.1 build
> nest build
Error The "@nestjs/swagger" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" nor "afterDeclarations()" function have been provided.
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
Render:
On Render, I did the following setup for build and run:
Build command:
Aug 1 10:24:28 AM > laboratorio_ferreira_api@0.0.1 build /opt/render/project/src
Aug 1 10:24:28 AM > nest build
Aug 1 10:24:28 AM
Aug 1 10:24:37 AM
Aug 1 10:24:37 AM Error The "@nestjs/swagger" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" nor "afterDeclarations()" function have been provided.
Aug 1 10:24:37 AM
Aug 1 10:24:37 AM  ELIFECYCLE  Command failed with exit code 1.
Aug 1 10:24:37 AM ==> Build failed 😞
It appears that it isnt a Heroku or Render problem, since they are different services and reproduce the same error.
Is there an existing issue for this?
Current behavior
I have the swagger plugin enabled in my project and If i run the build command locally it completes without any problem, but when i try to deploy to both Heroku and Render i get this error from the plugin when the build command is triggered:
Heroku: On Heroku, this is the command in Procfile:
Output log:
Render: On Render, I did the following setup for build and run: Build command:
Start command:
Output log:
It appears that it isnt a Heroku or Render problem, since they are different services and reproduce the same error.
Minimum reproduction code
https://github.com/danilloism/laboratorio_ferreira_api
Steps to reproduce
No response
Expected behavior
The build it's successful just like when its run locally.
Package
Other package
@nest/cli @nest/swagger
NestJS version
9.0.7
Packages versions
Node.js version
18.5.0
In which operating systems have you tested?
Other
Related issues:
9650 #9429