Skip to content

Conversation

@chux0519
Copy link

@chux0519 chux0519 commented Nov 5, 2025

  1. Issue: In the iOS MLC demo, after finishing “Stream Text” the status panel throws TypeError: Cannot read property
    'length' of undefined.
  2. Root cause: The native bridge’s last onChatUpdate emits {"delta": {"role": "assistant"}}. The JS layer forwards
    delta.content to the Vercel AI SDK without type checks, so the SDK receives undefined and crashes when it reads length.
  3. Fix: Update onChatUpdate in packages/mlc/src/ai-sdk.ts to enqueue a text-delta only when delta.content is a string;
    ignore any other shape.
9d6dba307ead68d448a06a39891e716c mlc_log

Note

Add a type guard in packages/mlc/src/ai-sdk.ts to only enqueue text-delta when delta.content is a string, ignoring other update shapes.

Written by Cursor Bugbot for commit 049d2b2. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Nov 5, 2025

@chux0519 is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant