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): prevent circular chunk deadlock when loading infographic editor

tianma-ifb51df7e6ebbf
diff --git a/apps/web/src/components/ai-elements/message.tsx b/apps/web/src/components/ai-elements/message.tsx
index 0cf8e6b4..eefb93d6 100644
--- a/apps/web/src/components/ai-elements/message.tsx
+++ b/apps/web/src/components/ai-elements/message.tsx
@@ -13,9 +13,6 @@ import {
} from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
import { cjk } from "@streamdown/cjk";
-import { code } from "@streamdown/code";
-import { math } from "@streamdown/math";
-import { mermaid } from "@streamdown/mermaid";
import type { UIMessage } from "ai";
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
import type { ComponentProps, HTMLAttributes, ReactElement } from "react";
@@ -321,7 +318,7 @@ export const MessageBranchPage = ({
export type MessageResponseProps = ComponentProps<typeof Streamdown>;
-const streamdownPlugins = { cjk, code, math, mermaid };
+const streamdownPlugins = { cjk };
export const MessageResponse = memo(
({ className, ...props }: MessageResponseProps) => (
diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts
index 6b8b4e02..83168454 100644
--- a/apps/web/vite.config.ts
+++ b/apps/web/vite.config.ts
@@ -345,6 +345,17 @@ export default defineConfig({
test: /[\\/]node_modules[\\/](?:@codemirror|@lezer|@uiw[\\/](?:react-)?codemirror|@uiw[\\/]codemirror-themes|codemirror)[\\/]/,
priority: 37,
},
+ {
+ name: "vendor-streamdown",
+ test: /node_modules[\\/](?:streamdown|@streamdown|micromark|mdast|unist|remark|rehype|vfile|zwitch|longest-streak|character-entities|property-information|space-separated-tokens|comma-separated-tokens|html-void-elements|ccount|devlop|bail|trough|unified)[\\/]/,
+ priority: 35,
+ // Streamdown and the unified/micromark/mdast parser stack rely on
+ // tight cross-module references and top-level initializer functions
+ // (e.g. unist-util-is convert() called at import time by mdast-util-phrasing).
+ // Splitting these modules across chunks via maxSize or entriesAware causes
+ // circular chunk evaluation order issues where convert() is undefined.
+ // Keep the entire Streamdown parsing graph atomic.
+ },
{
name: "vendor-tiptap-pm",
test: /node_modules[\\/]@tiptap[\\/]pm[\\/]/,