Skip to content

Bug Report: TypeError: metadata.suggestions is not iterable #940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jackkru69 opened this issue Apr 17, 2025 · 0 comments
Open

Bug Report: TypeError: metadata.suggestions is not iterable #940

jackkru69 opened this issue Apr 17, 2025 · 0 comments

Comments

@jackkru69
Copy link

jackkru69 commented Apr 17, 2025

Environment:

  • Official chat.vercel.ai UI template
  • Inference model: o3-mini

Description:
The suggestions panel attempts to iterate over metadata.suggestions without verifying that it’s an array. When metadata.suggestions is undefined or non‑iterable, a runtime error halts rendering.

Steps to Reproduce:

  1. Run the official chat.vercel.ai UI template with the o3‑mini model.
  2. Invoke the suggestions component (e.g., the backend returns no suggestions field or returns it as null).
  3. Open the browser’s Developer Console.

Actual Behavior:

Uncaught (in promise) TypeError: metadata.suggestions is not iterable
    at eval (client.tsx:38:25)
    at Artifact.onStreamPart (client.tsx:34:7)
    at DataStreamHandler.useEffect (data-stream-handler.tsx:41:28)
    …

The suggestions UI never appears, and errors flood the console.

Expected Behavior:
The panel should safely handle missing or non‑array metadata.suggestions and render (or remain empty) without errors.

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

No branches or pull requests

1 participant