hacsfiles/custom-sidebar/custom-sidebar.js:160:46 TypeError: undefined is not an object (evaluating 'getConfigurationElement(elements).cloneNode')
The code in the custom-sidebar.js is the following:
function createItem(elements, item) { var cln = getConfigurationElement(elements).cloneNode(true); if (cln) { cln.querySelector("paper-icon-item").querySelector("ha-icon").setAttribute("icon", item.icon); cln.querySelector("paper-icon-item").querySelector("span").innerHTML = item.item; cln.href = item.href; cln.setAttribute("data-panel", item.item); elements.insertBefore(cln, elements.children[0]); } }
Getting the following error in the HA log:
hacsfiles/custom-sidebar/custom-sidebar.js:160:46 TypeError: undefined is not an object (evaluating 'getConfigurationElement(elements).cloneNode')
The code in the custom-sidebar.js is the following:
function createItem(elements, item) { var cln = getConfigurationElement(elements).cloneNode(true); if (cln) { cln.querySelector("paper-icon-item").querySelector("ha-icon").setAttribute("icon", item.icon); cln.querySelector("paper-icon-item").querySelector("span").innerHTML = item.item; cln.href = item.href; cln.setAttribute("data-panel", item.item); elements.insertBefore(cln, elements.children[0]); } }
Installed version is 0.2.2, HA OS 2020.12.1.
Best Regards