vuelidate: Error: Maximum recursive updates exceeded. - with nested useVuelidate usage
When using nested validation, and a parent that displays validation errors in it’s template, any changes to the nested component causing a hot reload trigger a ‘Maximum recursive updates exceeded error’. Removing the reference to validation.$errors in the parent template resolves the error.
<!-- Parent -->
<template>
<span>Parent errors: {{ validation.$errors }}</span>
<Nested/>
</template>
<script lang="ts">
export default defineComponent({
components: {
Nested
},
setup() {
const rules: any = {};
const validation: Ref<Validation> = useVuelidate(rules, {});
console.log('Hot Reload: Parent');
return {
validation
};
}
})
</script>
<!-- Nested -->
<template>
<span>Nested</span>
</template>
<script lang="ts">
export default defineComponent({
setup() {
const rules: any = {};
const validation: Ref<Validation> = useVuelidate(rules, {});
console.log('Hot Reload: Nested:::');
return {};
}
})
</script>
Update the console log text to trigger a hot-reload which will trigger the maximum recursion error.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 5
- Comments: 16 (4 by maintainers)
I have this same problem but using useField.
For anyone seeking fast although not proper solution, use
$scopeproperty inuseVuelidatefunction: https://vuelidate-next.netlify.app/advanced_usage.html#scope-propertySorry to hear that. Understandable.
This is something we are working on. However, you could help us a lot by providing a failing test for that specific case!