You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem with the validation method "i18n.validate" from the "I18nService" while validating nested objects. I always get an "TypeError: Cannot convert undefined or null to object\n
This error does not occur, when I use the normal "validate" function of the "class-validator" library. Here I get the correct errors, but of course with missing translations.
I hope someone can help me. Maybe there is a bug in the "I18nService"?
{"TypeError: Cannot convert undefined or null to object\n at Function.keys (<anonymous>)\n at ...node_modules\\nestjs-i18n\\src\\utils\\util.ts:79:32\n at Array.map (<anonymous>)\n at formatI18nErrors (...node_modules\\nestjs-i18n\\src\\utils\\util.ts:64:17)\n at ...\\node_modules\\nestjs-i18n\\src\\utils\\util.ts:78:22\n at Array.map (<anonymous>)\n at formatI18nErrors (...\\node_modules\\nestjs-i18n\\src\\utils\\util.ts:64:17)\n at I18nService.validate (...\\node_modules\\nestjs-i18n\\src\\services\\i18n.service.ts:361:28)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at RestrictionCodePipe.transform (...\\src\\rc-maintenance\\pipes\\restriction-code.pipe.ts:19:43)"}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there,
I have a problem with the validation method "i18n.validate" from the "I18nService" while validating nested objects. I always get an "TypeError: Cannot convert undefined or null to object\n
This error does not occur, when I use the normal "validate" function of the "class-validator" library. Here I get the correct errors, but of course with missing translations.
I hope someone can help me. Maybe there is a bug in the "I18nService"?
Thank you,
Heiko
My Dto (Parent)
My Dto (Nested)
My Pipe
Stack Trace
Beta Was this translation helpful? Give feedback.
All reactions