agent icon indicating copy to clipboard operation
agent copied to clipboard

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

Open xdekoninck-pass opened this issue 1 year ago • 2 comments

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/@[email protected][email protected][email protected][email protected][email protected][email protected]__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/@[email protected][email protected][email protected][email protected][email protected][email protected]__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/@[email protected][email protected][email protected][email protected][email protected][email protected]__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!

xdekoninck-pass avatar Sep 27 '24 03:09 xdekoninck-pass

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?

davidkpiano avatar Sep 27 '24 12:09 davidkpiano

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

XavierDK avatar Sep 27 '24 16:09 XavierDK