-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
0.3.20 regression with NestJS, TypeORM and Swagger #10671
Comments
So, this bug is not related to typeorm, closing this. Dev response: nestjs/nest#13107 (comment) Explanation and temporal fix: nestjs/nest#13107 (comment) |
@OSA413 just a quick note that after walking through changes introduced in the latest version of For example, this issue could be solved without affecting any projects using TypeORM in combination with any other libs that rely on reflect-metadata by setting reflect-metadata as a peer dependency with |
In this case I'll keep this issue open for the maintainers to decide if they want this change or not |
I can confirm that this is fixed after version update (and clean package install)
Source: nestjs/swagger#2821 (comment) |
is there any chance this is going to be reconsidered (#10671 (comment))? We're getting more and more complaints regarding this issue (and the solution is far from obvious) |
If TypeORM remove If nestjs did the upgrade to the latest version of reflect-metadata, then what can be issue? |
You could still have
Both npm and yarn automatically install peer dependencies now Technically the only thing that would change is that now package managers, be it npm or yarn, would know that reflect-metadata should be automatically "hoisted" as it's supposed to be shared between packages that also rely on
Unfortunately, some folks still have old Not to mention anyone who's had "^0.3.19" in their package.json and didn't change anything but reinstalled dependencies would sadly see their projects broken (as 0.3.20 matches that criterion) Some refs:
|
the way peer deps work changed so many times that I'm not really sure how they currently work.
If nothing will be broken and it's that much of the issue right now, I can apply suggested changes. I'll wait for somebody to create a PR. |
Thank you @pleerock! |
I'm not clear on the issue the latest update to |
Here's a pretty basic reproduction repository with instructions in the README file https://github.com/phuffer/controller-broken-example/ |
I've done what kamilmysliwiec suggested in this PR |
Any progress? A roadmap? What's current progress with the issue? Maybe it would be helpful to release a beta version of packages for testing. |
@OSA413 I have merged your PR, but release will be later next month. You can use beta release (made automatically after PR is merged) for now. |
Ideally, we would love to see this fixed upstream in the |
Installing lates dev version of the package fixed the issue in the repo I provided |
I'm still looking into this, but don't yet know the cause. It does seem like NestJS is using |
I think I have discovered the cause. I should have a fix up for |
This should be fixed in |
Issue description
Upgrading to 0.3.20 broke NestJS + Swagger integration, downgrading to 0.3.19 fixes the issue
Expected Behavior
not regression
Actual Behavior
regression
Steps to reproduce
https://github.com/OSA413/nestjs-bug-swagger-api-property
My Environment
Additional Context
Reposted from NestJS' Discord
So, I recently updated packages and Swagger started to throw errors related to @ApiProperty (Optional) and circular dependency though a week ago it was just fine. I've managed to make an MRE from the whole project, here it is: https://github.com/OSA413/nestjs-bug-swagger-api-property
The DTO looks like this:
It's very interesting, because 1) it doesn't specify any type in the annotation, 2) it's a scalar type
Some other investigations:
For easier reproduction of the example I provided you'll need a Docker (because you need to connect to DB)
Package versions are listed in the repository,
package.lock
is providedHere's the log
After investigation I figured out that downgrading typeorm from 0.3.20 to 0.3.19 fixes the issue.
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
The text was updated successfully, but these errors were encountered: