From affcb445571f29818781a2b3c3a9b22a79dcd96b Mon Sep 17 00:00:00 2001 From: Mark VanLandingham Date: Thu, 5 Oct 2023 13:23:49 -0500 Subject: [PATCH] DEV: Don't attempt to render to empty element in RawRenderGlimmer (#23803) --- .../discourse/app/lib/raw-render-glimmer.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/app/lib/raw-render-glimmer.js b/app/assets/javascripts/discourse/app/lib/raw-render-glimmer.js index a42428107cf..6b7e22e303d 100644 --- a/app/assets/javascripts/discourse/app/lib/raw-render-glimmer.js +++ b/app/assets/javascripts/discourse/app/lib/raw-render-glimmer.js @@ -41,12 +41,14 @@ export default function rawRenderGlimmer(owner, renderInto, component, data) { schedule("afterRender", () => { const element = document.getElementById(id); - const componentInfo = { - element, - component, - data, - }; - renderGlimmerService.add(componentInfo); + if (element) { + const componentInfo = { + element, + component, + data, + }; + renderGlimmerService.add(componentInfo); + } }); return `<${type} id="${id}" class="${classNames.join(" ")}">`;