toonvanstrijp / nestjs-i18n

The i18n module for nestjs.
https://nestjs-i18n.com
Other
642 stars 106 forks source link

i18n Context undefined when throwing excepiton in middlewares #473

Open bruno-negreiros opened 1 year ago

bruno-negreiros commented 1 year ago

I registered the I18nMiddleware globally and before any custom middleware, but when trying to access the I18n context within this middleware, it is undefined. In other cases it can be accessed normally.

I registered the I18nMiddleware as follows: app.use(I18nMiddleware)

and the custom Middleware in the AppModule as follows: consumer.apply(TenantMiddleware).exclude('/tenant(.*)', '/authentication(.*)', '/api-key(.*)').forRoutes('*')

gonzalormonja commented 1 year ago

Hi! In my case change from "nestjs-i18n": "^10.1.0" to "nestjs-i18n": "^9.2.2" solve this problem.