[IMP] web: Added log information to help fix errors from services.

A typo fix is added.
Fix error from loading xml while widget is destroyed. Now that the xml
templates are loaded in the bundle, the error appears more frequently.

Part-of: odoo/odoo#95500
This commit is contained in:
Gorash
2022-09-14 20:25:01 +02:00
parent 48c267e9a5
commit ed2b117f5b
5 changed files with 7 additions and 5 deletions
@@ -11,7 +11,9 @@ export const publicLivechatService = {
return {
mountLivechatButton() {
const livechatButton = new LivechatButton(rootWidget, messaging);
livechatButton.appendTo(document.body);
livechatButton.appendTo(document.body).catch(error => {
console.info("Can't load 'LivechatButton' because:", error);
});
return livechatButton;
},
};
+1 -1
View File
@@ -267,7 +267,7 @@ QWeb2.Engine = (function() {
if (name && extend) {
// Clone template and extend it
if (!this.templates[extend]) {
return this.tools.exception("Can't clone undefined template " + extend);
return this.tools.exception("Can't clone undefined template '" + extend + "' to create '" + name + "'");
}
this.templates[name] = this.templates[extend].cloneNode(true);
this.extend_templates[name] = (this.extend_templates[extend] || []).slice();
+1 -1
View File
@@ -125,7 +125,7 @@ async function _startServices(env, toStart) {
})
.catch((error) => {
services[name] = error;
console.error(error);
console.error("Can't load service '" + name + "' because:", error);
})
.finally(resolve);
})
@@ -3865,7 +3865,7 @@ const SnippetOptionWidget = Widget.extend({
// widget start.
parentEl.removeChild(el);
if (widget.isContainer()) {
if (widget.isContainer() && !widget.isDestroyed()) {
return this._renderXMLWidgets(widget.el, widget);
}
});
@@ -831,4 +831,4 @@
export var Quiz = Quiz;
export var ConfirmationDialog = ConfirmationDialog;
export const websiteSlidesQuizNoFullscree = publicWidget.registry.websiteSlidesQuizNoFullscreen;
export const websiteSlidesQuizNoFullscreen = publicWidget.registry.websiteSlidesQuizNoFullscreen;