diff --git a/src/components/builder/validate/i18n.tsx b/src/components/builder/validate/i18n.tsx index 1dabd111..c5dcf442 100644 --- a/src/components/builder/validate/i18n.tsx +++ b/src/components/builder/validate/i18n.tsx @@ -16,10 +16,11 @@ export function useManageValidatorsTranslations( // set any missing translations useEffect(() => { - if (!value) { - throw new Error('Missing default (Formik) value for `translatedErrors`!'); - } - const newValue = {...value}; + const newValue = value + ? {...value} + : (Object.fromEntries(supportedLanguageCodes.map(code => [code, {}])) as NonNullable< + S['translatedErrors'] + >); const emptyDefaults = Object.fromEntries(keys.map(k => [k, ''])); for (const code of supportedLanguageCodes) { newValue[code] = {...emptyDefaults, ...newValue[code]};