From b1976498d0c4f81fca016627645d2547e0a743bb Mon Sep 17 00:00:00 2001 From: foxriver76 Date: Mon, 30 Oct 2023 09:13:35 +0100 Subject: [PATCH] also log the script src --- src/src/Vis/visEngine.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/src/Vis/visEngine.jsx b/src/src/Vis/visEngine.jsx index ca76e7264..6de06afbc 100644 --- a/src/src/Vis/visEngine.jsx +++ b/src/src/Vis/visEngine.jsx @@ -1427,9 +1427,8 @@ class VisEngine extends React.Component { */ static async loadScriptsOfOneWidgetSet(widgetSet) { - for (let i = 0; i < widgetSet.length; i++) { + for (const { oldScript, newScript } of widgetSet) { try { - const { oldScript, newScript } = widgetSet[i]; newScript.appendChild(document.createTextNode(oldScript.innerHTML)); oldScript.parentNode.replaceChild(newScript, oldScript); @@ -1438,7 +1437,7 @@ class VisEngine extends React.Component { newScript.onload = resolve; }); } catch (e) { - console.error(`Cannot load script: ${JSON.stringify(e)}`); + console.error(`Cannot load script "${newScript.src}": ${JSON.stringify(e)}`); } } }