Getting an error while trying to update a custom module of mine. I get this error when trying to edit any page which uses a dynamic widget I'm making.
UncaughtPromiseError > OwlError
Uncaught Promise > An error occured in the owl lifecycle (see this Error's "cause" property)
....
Caused by: TypeError: Cannot read properties of undefined (reading 'forEach')
Here is the contents of the main.js from which I think the error stems from? I'm unsure because there is no 'forEach' in my code.
/** @odoo-module **/
import publicWidget from "@web/legacy/js/public/public_widget";
publicWidget.registry.BannerManager = publicWidget.Widget.extend({
selector: '.banner-manager',
init: function () {
this.rpc = this.bindService("rpc");
},
start: function () {
let bannerRow = this.el.querySelector('#banner-manager-row');
if (bannerRow){
let html = ``;
let count = 0;
this._fetchData().then(banners => {
while(count html += ` `;
} else {
html += `">
`;
}
count++;
}
bannerRow.innerHTML = html;
});
}
},
async _fetchData() {
const bannerData = await this.rpc('/get_banners',{});
return(bannerData);
},
});
export default publicWidget.registry.BannerManager;
Any help debugging would be appreciated.