Uncaught TypeError: Cannot read property '_ua' of undefined

Uncaught TypeError: Cannot read property '_ua' of undefined
    at Object.search [as hits] (autocomplete.js:4048)
    at algolia.js:9

My js code

(function (){


  const client = algoliasearch('HPATZ4NM4E', '1408f1c5e4d561613df6213095de27eb');
  const index = client.initIndex('users');
  //const name = client.initIndex('name');

  autocomplete('#aa-search-input', {hint: false},
      {
        source: autocomplete.sources.hits(index, { hitsPerPage: 3 }),
        displayKey: 'name',
        templates: {
          header: '<div class="aa-suggestions-category">Vendors</div>',
          suggestion({_highlightResult}) {
            return `<span>${_highlightResult.name.value}</span>`;
          }
        }
      }
  );

})();

I am stuck please help.

Hi @abdellah, would it be possible to create a codesandbox with one of our starter templates to demonstrate the issue?