nestjs-i18n icon indicating copy to clipboard operation
nestjs-i18n copied to clipboard

for people who face: typeerror: cannot read properties of undefined (reading 'pipe')

Open delai opened this issue 11 months ago • 0 comments

Describe the bug

add

    if (value.constructor.name === 'I18nContext') {
      return value
    }

at the beginning of the transform function in your ValidationPipe like this image

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.

delai avatar Mar 19 '24 08:03 delai