-
-
Notifications
You must be signed in to change notification settings - Fork 328
RuntimeError("Hook stack is in an invalid state") #1250
-
Hi,
When I load up my ReactPy server I'm getting RuntimeError("Hook stack is in an invalid state") exceptions. These seem to be occurring randomly, they are not page or action specific. I've disabled REACTPY_ASYNC_RENDERING and confirmed that the exceptions still occur when Layout._serial_render() is used. The server recovers by automatically re-rendering the page following the exception.
I've loaded up the server with a simple 'button-click' app using asyncio and multiple instances of
playwright. It fails every time. See test_loading.py
The problem only occurs when multiple Layout.aenter contexts are open.
I'd like to fix the problem and I'm looking for some pointers as to what might be causing it.
Cheers, Steve
Beta Was this translation helpful? Give feedback.
All reactions
I've seen this a few times as well.
This PR has a fix, but it needs to be pulled out into a smaller PR.
- J - Bug fix for corrupted hook state - change hook state to a contextvar
On a similar note, _ThreadSafeQueue should probably be replaced with janus.
Replies: 1 comment 1 reply
-
I've seen this a few times as well.
This PR has a fix, but it needs to be pulled out into a smaller PR.
- J - Bug fix for corrupted hook state - change hook state to a contextvar
On a similar note, _ThreadSafeQueue should probably be replaced with janus.
Beta Was this translation helpful? Give feedback.
All reactions
-
New PR has been opened that uses the previously mentioned changes as a baseline
Beta Was this translation helpful? Give feedback.