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: Rewrite "No metadata found" error more clearly, adding explanation that perhaps a using codebase is implemented but no flags have been written #1124

Closed
capndave opened this issue Jun 10, 2021 · 3 comments
Labels
status: done/released Issue has been completed, no further action is needed. type: fix Issues describing a broken feature.

Comments

@capndave
Copy link

Description

src/validation/ValidationExecutor.ts conditionally returns the following error: No metadata found. There is more than once class-validator version installed probably. You need to flatten your dependencies. There are two issues with this error.

  • the error has typos/incorrect grammar. "There is more than once class-validator version installed probably" should instead read "There are probably more than one class-validator versions installed", or "There are probably multiple class-validator versions installed"
  • This error sometimes arises when a developer uses a module as a dependency that itself depends on class-validator, but the developer has not yet used a class-validator flag in their file or codebase. One such case is documented in a type-graphql issue, for example.

Proposed Solution

Update the error message with correct grammar and add a sentence explaining that validation flags are expected but not present in the code.

@capndave capndave added status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature. labels Jun 10, 2021
@NoNameProvided
Copy link
Member

The error message is now updated to the following:

No validation metadata found. No validation will be  performed. There are multiple possible reasons:` 
  - There may be multiple class-validator versions installed. You will need to flatten your dependencies to fix the issue.
  - This validation runs before any file with validation decorator was parsed by NodeJS.

@NoNameProvided NoNameProvided added status: fixed Issues with merged PRs, but not released yet. and removed status: needs triage Issues which needs to be reproduced to be verified report. labels Dec 2, 2022
@NoNameProvided NoNameProvided added status: done/released Issue has been completed, no further action is needed. and removed status: fixed Issues with merged PRs, but not released yet. labels Dec 9, 2022
@NoNameProvided
Copy link
Member

This feature/fix has been released in 0.14.0.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: done/released Issue has been completed, no further action is needed. type: fix Issues describing a broken feature.
2 participants