Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(web): keep @antv/infographic registry atomic to prevent render failure

tianma-ifff9194a8e878
diff --git a/apps/web/src/components/InfographicEditorPane.tsx b/apps/web/src/components/InfographicEditorPane.tsx
index 0e3db9ae..5b3e4d0c 100644
--- a/apps/web/src/components/InfographicEditorPane.tsx
+++ b/apps/web/src/components/InfographicEditorPane.tsx
@@ -329,10 +329,14 @@ export default function InfographicEditorPane({
setRenderError(null);
setPreviewReady(true);
} catch (caught) {
+ console.error("Failed to render infographic", caught);
setRenderError(caught instanceof Error ? caught.message : t("infographic.renderError"));
instanceRef.current = null;
}
- }).catch(() => { if (!cancelled) setRenderError(t("infographic.renderError")); });
+ }).catch((caught) => {
+ console.error("Failed to load @antv/infographic", caught);
+ if (!cancelled) setRenderError(t("infographic.renderError"));
+ });
}, 250);
return () => { cancelled = true; window.clearTimeout(timer); };
}, [syntax, readOnly, t]);
diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts
index 83168454..4c24ca76 100644
--- a/apps/web/vite.config.ts
+++ b/apps/web/vite.config.ts
@@ -335,6 +335,15 @@ export default defineConfig({
// before Config is initialized, crashing the lazy diagram editor.
// Keep the graph atomic and defer the resulting chunk instead.
},
+ {
+ name: "vendor-infographic",
+ test: /node_modules[\\/]@antv[\\/]infographic[\\/]/,
+ priority: 39,
+ // AntV Infographic registers its template and shape catalogs through
+ // internal registries. Size-based splitting across chunks breaks
+ // initialization order, causing registry map lookups (e.g. .set)
+ // to fail on undefined during chunk evaluation. Keep this graph atomic.
+ },
{
name: "vendor-prosemirror",
test: /node_modules[\\/](prosemirror-|orderedmap|rope-sequence)[\\/]/,