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

This commit is contained in:
tianma-if committed 2026-09-27 16:14:44 +08:00
1 parent b51df7e6eb
commit ff9194a8e8
2 files changed
+14 -1

No files matched your search

@@ -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]);
+9
View File
@@ -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)[\\/]/,