Hello martin,
There is an event which is not loading properly. If still the console log is required, fire the statement without on load event. It will work. what I mean to say is
original text-
searchWidget.on("load", function (evt) { console.log("Search widget has loaded!"); });
Replace it with-
console.log("Search widget has loaded!");
Without event