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

Error message with Typescript < v4.8 is confusing #2867

Open
2 of 4 tasks
Woodz opened this issue Mar 7, 2024 · 3 comments
Open
2 of 4 tasks

Error message with Typescript < v4.8 is confusing #2867

Woodz opened this issue Mar 7, 2024 · 3 comments

Comments

@Woodz
Copy link

Woodz commented Mar 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Using latest @nestjs/swagger with Typescript v4.7 fails at runtime with message Error Nest CLI plugin does not support TypeScript < v4.8

This is quite confusing because the message doesn't mention that this error is from nestjs/swagger and does not get flagged up during dependency installation

Minimum reproduction code

Reproduced privately

Steps to reproduce

  1. yarn install
  2. yarn nest start

Expected behavior

  1. I expect this package to use npm peer dependencies to define supported Typescript versions
  2. I expect this package to mention this package name in the error

Package version

7.3.0

NestJS version

9.0.11

Node.js version

18.13.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@kamilmysliwiec
Copy link
Member

This is tricky because not everyone who uses @nestjs/swagger uses the Swagger CLI Plugin (hence, the runtime check).

@Woodz
Copy link
Author

Woodz commented Mar 8, 2024

This is tricky because not everyone who uses @nestjs/swagger uses the Swagger CLI Plugin (hence, the runtime check).

Oh apologies for not being clear. I was not recommend dropping the runtime check. Instead, I think that this runtime check error should be reworded to improve clarification, and additionally peerDependency added to generate an additional warning at installation time

@kamilmysliwiec
Copy link
Member

What I'm trying to say is that adding a peer dependency might be confusing - AFAIK most people still dont use the CLI plugin, meaning, most would receive a misguided warning about their TS incompatibility even if it doesn't apply to their projects.

When it comes to rewording the error message, I'm all in! Would you like to create a PR for this?

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

No branches or pull requests

2 participants