=> {
+ const el = document.getElementById(id);
+
+ try {
+ if (!el) throw new Error(`#${id} element not found`);
+
+ const data = v.parse(schema, el.dataset);
+ // Set before any query runs, i.e. before the children render
+ setGraphqlEndpoint(data.graphqlEndpoint);
+
+ // Rendering before the locale data is in would flash the raw keys
+ await setupI18n();
+
+ createRoot(el).render(
+
+
+
+
+ {children(data)}
+
+
+
+ ,
+ );
+ } catch (error) {
+ console.error(`Failed to mount #${id}`, error);
+ if (el) el.hidden = true;
+ document.getElementById(`${id}-error`)?.removeAttribute("hidden");
+ }
+};
diff --git a/templates/app.html b/templates/app.html
index 0763b8d12..d5aced6d9 100644
--- a/templates/app.html
+++ b/templates/app.html
@@ -23,5 +23,9 @@ Please see LICENSE files in the repository root for full details.
+
+
+ {{ _("mas.loading_failed") }}
+