run-llama / create-llama

The easiest way to get started with LlamaIndex
MIT License
1.05k stars 135 forks source link

Error: Maximum update depth exceeded. #397

Open cognitiveRobot opened 3 weeks ago

cognitiveRobot commented 3 weeks ago

I am building an RAG application and the following error is blocking my deployment. Error message received:

react-dom.development.js:26793 Uncaught (in promise) Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
    at throwIfInfiniteUpdateLoopDetected (react-dom.development.js:26793:11)
    at getRootForUpdatedFiber (react-dom.development.js:7627:3)
    at enqueueConcurrentRenderForLane (react-dom.development.js:7549:10)
    at forceStoreRerender (react-dom.development.js:12049:14)
    at handleStoreChange (react-dom.development.js:12028:7)
    at eval (index.mjs:155:42)
    at Array.setter (index.mjs:456:21)
    at eval (index.mjs:141:25)
    at mutateByKey (index.mjs:399:21)
    at internalMutate (index.mjs:302:12)
    at eval (index.mjs:380:76)
    at onUpdate (index.mjs:260:7)
    at processDataProtocolResponse (index.mjs:939:5)
    at async callChatApi (index.mjs:1031:14)
    at async getStreamedResponse (index.mjs:222:10)
    at async processChatStream (index.mjs:1243:42)
    at async eval (index.mjs:338:9)

Set up details:

Next.js 14.2.14
"@llamaindex/core": "^0.2.6"
"ai": "3.3.42",
"ajv": "^8.12.0",

Model: `llama-3.1-8b-instant` 
Model Provider: `qroq`.

To reproduce:

  1. Run npx create-llama@latest from v0.3.8
  2. Follow default setup with python back-end.
  3. Send query couple of times.

Can you please help me to fix the issue?

marcusschiesser commented 3 weeks ago

It's caused by this vercel/ai issue: https://github.com/vercel/ai/issues/1610 - we'll add a workaround to the https://github.com/run-llama/chat-ui components

cognitiveRobot commented 3 weeks ago

@marcusschiesser Thanks for the reply. What is the expected date of this workaround?

marcusschiesser commented 3 weeks ago

It's only in dev mode so it's not a blocker, but we should have the workaround next week

cognitiveRobot commented 2 weeks ago

I get the same error on prod when send query "physical standards for letters?"

fd9d1056-3022f0b0fc61dde2.js:1 Uncaught (in promise) Error: Minified React error #185; visit https://react.dev/errors/185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at ik (fd9d1056-3022f0b0fc61dde2.js:1:110228)
    at nf (fd9d1056-3022f0b0fc61dde2.js:1:26356)
    at ns (fd9d1056-3022f0b0fc61dde2.js:1:25972)
    at rj (fd9d1056-3022f0b0fc61dde2.js:1:44328)
    at fd9d1056-3022f0b0fc61dde2.js:1:44206
    at 570-ca2dfee6f5294646.js:1:1201783
    at Array.l (570-ca2dfee6f5294646.js:1:1198620)
    at 570-ca2dfee6f5294646.js:1:1196369
    at u (570-ca2dfee6f5294646.js:1:1198253)
    at em (570-ca2dfee6f5294646.js:1:1197684)

Run commands

//@backend
$ python main.py

//@frontend
$ npm run build
$npx serve@latest out

app created from v0.3.11

Cheers