Home

Fixed: v-data-table infinite update loop in component render function error in testing

In this aticle we discuss how to fix the following error:


console.error node_modules/vue/dist/..
  [Vue warn]: You may have an infinite update loop in a component render function.

  Found in

  ---> <VDataTable>

This error was currently occuring in beta version of vue-test-utils or @vue/test-utils which is greater than v1.0.0-beta29. And I about to say you a hacky way to disable it.

Solution 1

You can downgrade your vue-test-utils which is now @vue/test-utils

npm install @vue/test-utils@1.0.0-beta.29

Solution 2

You can disable console error in Jest, using mockImplementation

beforeEach(() => {
  jest.spyOn(console, 'error').mockImplementation(() => {});
});


Last Updated on

Next Post: Rules vs Guidelines →

Comments