"No generated validation code is available" error when rule with RepetitionNotUnique should fire

Hello,

we receive an error message in our application which we could not make sense of:

This happens when a validation rule is supposed to fire that uses RepetitionNotUnique an nothing more:
validation rule

We have this rule for several fields, and for each one, the above shown error message is shown as soon as the input should be validated, i.e. when leaving the field of the inline repeat. All other rules in our model work fine.

I tried our models in the Installer Preview Applicaion, where everything works as expected and no error is shown, so I strongly assume there is something wrong in our application.

Has anyone dealt with this kind of error before and can give us a hint where we could be looking in our code?

I tagged this entry as Kernel, pls let me know if another category is more suitable. Thanks in advance!

Hi,

this error can occur when the localizer tries to format a value within a localized message.
The source could be the error message of that validation rule. Does it have any placeholders, e.g. $field.value$ ?

The error will be thrown if the document model is not available to the localizer.
Usually this means that this model has not been loaded to the client’s model slice of the redux store.

The document model is necessary to find out about the data type of the field and derive the appropriate formatting approach from it.

Btw. In 2024.06 this error can no longer occur since the localizer does no longer depend on the document model in that version.

Thank you very much, Erik! The rule does indeed use placeholders in the error message, so I assume that this is exactly the problem, so I marked the post as resolved. I’m happy to hear that the update should resolve this issue without any more changes on our side :slight_smile: