Skip to content
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

TypeError: Cannot read properties of undefined (reading 'Symbol(Symbol.asyncIterator)') #53

Open
xdekoninck-pass opened this issue Sep 27, 2024 · 2 comments

Comments

@xdekoninck-pass
Copy link

Hi there 👋,

First, thank you for creating this amazing library!

I encountered an error when using the fromTextStream function. Here’s the stack trace:

TypeError: Cannot read properties of undefined (reading 'Symbol(Symbol.asyncIterator)')
    at eval (webpack-internal:///(action-browser)/./node_modules/.pnpm/@statelyai+agent@1.1.5_openai@4.63.0_zod@3.23.8__react@18.3.1_sswr@2.1.0_svelte@4.2.19__svelt_ugsjaykaivjxi2ewh7imf5h4te/node_modules/@statelyai/agent/dist/index.mjs:204:39)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
 ⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'Symbol(Symbol.asyncIterator)')
    at eval (webpack-internal:///(action-browser)/./node_modules/.pnpm/@statelyai+agent@1.1.5_openai@4.63.0_zod@3.23.8__react@18.3.1_sswr@2.1.0_svelte@4.2.19__svelt_ugsjaykaivjxi2ewh7imf5h4te/node_modules/@statelyai/agent/dist/index.mjs:204:39)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
 ⨯ unhandledRejection: TypeError: Cannot read properties of undefined (reading 'Symbol(Symbol.asyncIterator)')
    at eval (webpack-internal:///(action-browser)/./node_modules/.pnpm/@statelyai+agent@1.1.5_openai@4.63.0_zod@3.23.8__react@18.3.1_sswr@2.1.0_svelte@4.2.19__svelt_ugsjaykaivjxi2ewh7imf5h4te/node_modules/@statelyai/agent/dist/index.mjs:204:39)

The error occurs when trying to read Symbol(Symbol.asyncIterator), which appears to be undefined.

Steps to reproduce:

  • Launch the Tic-Tac-Toe example.
  • Invoke the gameReporter.
  • It throws the error mentioned above.

Additionally, I get the same error when using the agent.streamText() method.

What’s interesting is that calling streamText from the vercel 'ai' package works correctly.

Do you have any suggestions on how to resolve this, or is this potentially a bug?

Thanks again for your time and support!

@davidkpiano
Copy link
Member

This may be a bug. The latest release is not up-to-date with the latest AI SDK, which may be what is causing problems.

Does it happen all the time?

@XavierDK
Copy link

I identified the issue and have submitted a pull request to resolve it. (Note: this was originally reported using my other account.)

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

3 participants