What's broken?
In packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts line 147:
const toolCalls = Array.from(
toolCallStreams.values().filter((data) => data.complete),
);
Map.prototype.values() returns a MapIterator, not an array. Iterators do not have a .filter() method. This throws TypeError: toolCallStreams.values(...).filter is not a function at runtime, causing all tool calls to never be detected as complete — AI tool call suggestions never appear in the UI.
In the bundled output (dist/server-CafGbRLa.js line 479) this becomes:
let p = !1, m = Array.from(s.values().filter((e) => e.complete)); // ❌
What did you expect to happen?
Tool calls that have finished streaming should be detected and shown as suggestions via the AIMenuController.
Steps to reproduce
- Use a BlockNote editor with
@blocknote/xl-ai AI extension
- Send messages that trigger tool calls from the model
- Observe that tool call suggestions never appear in the UI
BlockNote version
v0.52.1 (latest)
Fix
const toolCalls = Array.from(
- toolCallStreams.values().filter((data) => data.complete),
-);
+ toolCallStreams.values(),
+).filter((data) => data.complete);
Environment
All runtimes — this is a pure JavaScript bug, not environment-specific.
Contribution
What's broken?
In
packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.tsline 147:Map.prototype.values()returns a MapIterator, not an array. Iterators do not have a.filter()method. This throwsTypeError: toolCallStreams.values(...).filter is not a functionat runtime, causing all tool calls to never be detected as complete — AI tool call suggestions never appear in the UI.In the bundled output (
dist/server-CafGbRLa.jsline 479) this becomes:What did you expect to happen?
Tool calls that have finished streaming should be detected and shown as suggestions via the AIMenuController.
Steps to reproduce
@blocknote/xl-aiAI extensionBlockNote version
v0.52.1 (latest)
Fix
Environment
All runtimes — this is a pure JavaScript bug, not environment-specific.
Contribution