Closed julianpoemp closed 9 months ago
Might be related to https://github.com/nestjs/mapped-types/pull/1225#issue-1992458711 cc @KuanWenChen
@julianpoemp I can't reproduce the problem.
This simple code also can't reproduce the problem.
But I will try to rewrite the code to minimize the impact on the package
@KuanWenChen yes, the repository I created to reproduce this issue doesn't trigger the error. I don't know why, but I know that this error occurs in my other (private) project and that it's solved when I downgrade @nestjs/swagger...
At the moment I don't know how to make this error reproducible. I'll keep trying...
@julianpoemp I think I can't rollback something to mapped-type v2.0.2. It's going to cause _typeMetadatas, _exposeMetadatas, and _excludeMetadatas inherit incorrectly (Test Failed) .
If you have any case that could reproduce the problem, I would try to fix it.
Hi @KuanWenChen ! I managed to reproduce this error in this repository . In short the error is reproducible when you have something like this.
@Exclude()
export class UserPublicDto {
@Expose() @IsString()
username: string;
}
@Exclude()
export class UserDto extends UserPublicDto {
@Expose() @IsString()
password: string;
}
@Exclude()
export class UserUpdateDto extends OmitType(UserDto, ['password']) {
}
The OmitType is important here as well as that we are using it on a class which already extends from another class. This issue is not reproducible on 7.1.14
@YeritsyanTigran thank you very much for the reproduction!
@kamilmysliwiec This problem cannot be reproduced in @nestjs/mapped-types@2.0.4. I think it has been fixed in mapped-types-issue-1225. The package dependency has not been updated to 2.0.4, as indicated here.
Is it solved or closed because it couldn't be reproduced?
It should be fixed in 7.1.17
Is there an existing issue for this?
Current behavior
I updated nestjs and other dependencies to the latest version and I get an error message as soon as I start serving the application:
previous, working installation:
current, failing installation:
AccountCreateRequestDto:
I'm using NodeJS 18 and Nx 17.0.3
Minimum reproduction code
https://github.com/julianpoemp/nestjs-swagger-issues
Steps to reproduce
Unfortunately, I wasn't able to reproduce the error in a minimum reproduction code.
Now the error should appear, but it doesn't. The project where the error appears is not public, I can't reference it.
Expected behavior
The error messages should disappear.
Package version
7.1.16
NestJS version
10.2.10
Node.js version
18.18.2
In which operating systems have you tested?
Other
The error disappears when I downgrade @nestjs/swagger to 7.1.14. The other dependencies can be updated to the latest version.