Skip to content
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

fix: swagger crashed while using any Param/Query/Body decorator in a monorepo with pnpm #3223

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

winuxx
Copy link
Contributor

@winuxx winuxx commented Jan 7, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

…monorepo with pnpm.

Workaround: use ApiParam, ApiQuery, ApiBody instead.
@kamilmysliwiec
Copy link
Member

Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project).

@winuxx
Copy link
Contributor Author

winuxx commented Jan 9, 2025

I have provided a repository:
https://github.com/winuxx/nest-swagger-monorepo

@kamilmysliwiec
Copy link
Member

If you use esbuild to build your package/library, @nestjs/swagger won't work as expected (esbuild does not produce types metadata)

@winuxx
Copy link
Contributor Author

winuxx commented Jan 10, 2025

If you use esbuild to build your package/library, @nestjs/swagger won't work as expected (esbuild does not produce types metadata)

I see. But nest is working fine for me, and I can make a workaroud that use ApiParam/ApiQuery/ApiBody from @nestjs/swagger. So I think maybe swagger should not throw an exception while types metadata is empty.

@kamilmysliwiec kamilmysliwiec merged commit 81e1d02 into nestjs:master Jan 10, 2025
1 check passed
@kamilmysliwiec
Copy link
Member

lgtm

@Mittcio
Copy link
Contributor

Mittcio commented Jan 10, 2025

Will that help with #3220 (comment) too?
You say what is not problem here, what types is always ok

@winuxx
Copy link
Contributor Author

winuxx commented Jan 11, 2025

Will that help with #3220 (comment) too? You say what is not problem here, what types is always ok

yes, I think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants