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

I18nContext.current() return undefined #590

Open
5 tasks done
vqhdev opened this issue Oct 22, 2023 · 0 comments
Open
5 tasks done

I18nContext.current() return undefined #590

vqhdev opened this issue Oct 22, 2023 · 0 comments

Comments

@vqhdev
Copy link

vqhdev commented Oct 22, 2023

Describe the bug

I encountered the I18nContext.current() returning undefined:

....\i18n-error\src\http-exception.filter.ts:21
message: i18n.t(test.${status}),
^
TypeError: Cannot read properties of undefined (reading 't')

You can access my entire codebase here (https://github.com/vqhdev/nestjs-i18n-error)

Reproduction

I'm facing an issue with the HttpException filter when deliberately sending invalid data to the server. The error occurs when sending the following curl request:

curl -X POST http://127.0.0.1:3000/test -H "Content-Type: application/json" -d "{\"h\":\"}"

Or with any data that doesn't comply with the application/json format.

System Info

Binaries:
    Node: 18.18.2
    npm: 9.8.1
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (117.0.2045.60)
    Internet Explorer: 11.0.19041.1566

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant