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

Error "Maximum update depth exceeded" #25

Open
lexermal opened this issue Nov 1, 2024 · 1 comment
Open

Error "Maximum update depth exceeded" #25

lexermal opened this issue Nov 1, 2024 · 1 comment

Comments

@lexermal
Copy link

lexermal commented Nov 1, 2024

Hello, and thank you for this fantastic demo project! I’m reporting an issue I encountered when setting up the project from the main branch.

Issue Details:

  • Setup: I followed the setup instructions for the Node environment, using Livekit credentials and an OpenAI key.
  • Errors: Running the app triggered "Maximum update depth exceeded" errors in transcript.tsx and use-agent.tsx as soon as the conversation started.

Temporary Workarounds:

  • In transcript.tsx: I wrapped handleScrollVisibility in a useEffect function with conditions on scrollContainerRef, scrollButtonRef, and displayTranscriptions.

  • In use-agent.tsx (line 122): I updated state only if mergedSorted had changed, using the following check:

    if (
        mergedSorted.length !== displayTranscriptions.length ||
        mergedSorted.some((item, index) => {
            const currentItem = displayTranscriptions[index];
            return (
                item.segment.id !== currentItem.segment.id ||
                item.segment.text !== currentItem.segment.text ||
                item.segment.firstReceivedTime !== currentItem.segment.firstReceivedTime ||
                item.segment.lastReceivedTime !== currentItem.segment.lastReceivedTime
            );
        })
    ) {
        setDisplayTranscriptions(mergedSorted);
    }

I’m not certain if these solutions are optimal, which is why I haven’t submitted a pull request. However, I hope this information helps to resolve the issues quickly.

@AngeloGiacco
Copy link

i had to do something similar to fix 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

No branches or pull requests

2 participants