nestjs-i18n
nestjs-i18n copied to clipboard
for people who face: typeerror: cannot read properties of undefined (reading 'pipe')
Describe the bug
add
if (value.constructor.name === 'I18nContext') {
return value
}
at the beginning of the transform function in your ValidationPipe
like this
Reproduction
@I18n() i18n: I18nContext
System Info
@I18n() i18n: I18nContext
Used Package Manager
npm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.