#Profile Maximum update depth exceeded.

13 messages · Page 1 of 1 (latest)

desert quarry
#

I know that the stack size is 50 for TS. I am getting this stack error but as far as ai can see from the callback there is no loop.

How can i make TS/JS print the full stack trace so i can find the loop?

Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.

Sadly the below stack is not copy-able.

gleaming ocean
#

@desert quarry The "maximum stack size for TS" is a compile-time thing, something you might run into if you have really deeply nested recursive types.

desert quarry
#

docs say max is 50,

#

in my case a lot of stuff is callback based, so it might get that deep from normal operation

gleaming ocean
#

This isn't Typescript at all, this is JS runtime stuff.

#

(And specifically, React)

desert quarry
#

ah, fair enough.

#

!solved

gleaming ocean
#

Not saying you can't look for help here - (though Reactiflux is also a good option); but it's probably a bug in the React code.

desert quarry
#

I know that its likely a bug, thats why i am asking if you guys know a way to make the error more definitive

gleaming ocean
#

@desert quarry I don't think you'll be able to get more information from that error itself - this isn't really a "stack" issue - it's a React rerendering issue and React renders don't all happen in a single stack

#

You should be able to get an idea of where the error is happening, I'd expect the stack to point to somewhere in your code that's relevant.

#

But there really isn't a "full stack trace" to print.