streamlit: `st.dataframe` crashes with maximum update depth exceeded
Checklist
- I have searched the existing issues for similar issues.
- I added a very descriptive title to this issue.
- I have provided sufficient information below to help reproduce this issue.
Summary
Updating tables on the sidebar makes the browser go crazy and eventually crash due to maximum update depth exceeded.
- Browser is unresponsive
- Adjusting the width of the sidebar makes the problem go away (sometimes)
- Some tables just crash before even the first render
- This has been happening for a while (min 3 months)
Screencast from 2024-01-12 11-38-00.webm
Reproducible Code Example
with st.sidebar:
container = st.empty()
while True:
container.dataframe(...)
time.sleep(1)
Steps To Reproduce
No response
Expected Behavior
No response
Current Behavior
No response
Is this a regression?
- Yes, this used to work in a previous version.
Debug info
- Streamlit version: 1.2x
- Python version: irrelevant
- Operating System: irrelevant
- Browser: blink
Additional Information
Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings. at fl (http://192.168.1.42:8501/static/js/main.3ab8e8d9.js:2:2251371) at xa (http://192.168.1.42:8501/static/js/main.3ab8e8d9.js:2:2223133) at http://192.168.1.42:8501/static/js/7673.0828a05e.chunk.js:2:334183 at http://192.168.1.42:8501/static/js/7673.0828a05e.chunk.js:2:349353 at http://192.168.1.42:8501/static/js/7673.0828a05e.chunk.js:2:293066 at http://192.168.1.42:8501/static/js/7673.0828a05e.chunk.js:2:293268 at http://192.168.1.42:8501/static/js/7673.0828a05e.chunk.js:2:289446 at http://192.168.1.42:8501/static/js/7673.0828a05e.chunk.js:2:289688 at Dl (http://192.168.1.42:8501/static/js/main.3ab8e8d9.js:2:2263107) at t.unstable_runWithPriority (http://192.168.1.42:8501/static/js/main.3ab8e8d9.js:2:3040959)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 39
- Comments: 39
Commits related to this issue
- Update glide-data-grid to version 6.0.4 (#7779) ## Describe your changes Glide-data-grid had a [major update](https://github.com/glideapps/glide-data-grid/pull/810). This PR updates to this versi... — committed to streamlit/streamlit by lukasmasuch 3 years ago
- Update glide-data-grid to version 6.0.4 (#7779) ## Describe your changes Glide-data-grid had a [major update](https://github.com/glideapps/glide-data-grid/pull/810). This PR updates to this versi... — committed to zyxue/streamlit by lukasmasuch 3 years ago
- Went back to streamlit version where bug does not appear:https://github.com/streamlit/streamlit/issues/7949 Bug: Display of Pandas Dataframe not possible — committed to alexanderp99/RAG-enhanced-local-LLM by deleted user 3 years ago
- Fix dataframe maximum update depth error (#9490) ## Describe your changes Fixes an issue with the dataframe component that causes random crashes:  ## Describe your changes Fixes an issue with the dataframe component that causes random crashes:  to the initial post.
Your feedback helps us prioritize which bugs to investigate and address first.
Good news 🙌: After many hours of trying various things to reproduce this issue, I finally got to a setup that allows me to reproduce it in almost every rerun with a very specific setup: an old monitor set to a 1280 x 720 resolution, with the tab being zoomed out to 75%, and a script containing lots of dataframes with
use_container_width=True& vertical scrolling in different containers (sidebar, columns, popover, tabs) 😅 Finally, there is some hope to fully fixing this soon 🙏Thanks to everyone here for all the input! Especially to @ChojnackiKRZ & @oasalonen for the hints on the resolution.
Same issue, but I noticed one potential triggering condition that I didn’t see mentioned here yet:
The problem only occurs for me when I load the page on my external display. I don’t have access to my external monitor at the moment, and now I cannot reproduce the issue at all when loading it on my primary display (MacBook). Some weird interaction with primary/secondary display or different resolutions +
use_container_width=True?Specs:
In my case this error was related to:
https://github.com/user-attachments/assets/4fd745bf-8d76-4089-bbc2-959bb3176d29
getting this error in version 1.37
I have the same problem on streamlit version 1.36.0
I can’t share my actual code, but it is a dataframe displayed in a container, in a tab, in a column, something like this:
The error only occurs for the dataframe in tab_a. The error only occurs when the site is deployed, ie not when running locally. The error only occurs when an option to hide a few other arbitrary containers (st.markdown and st.tabs) is checked, i.e. the dataframe displays correctly when the site launches, but breaks after a user interaction with another element.
The dataframes are similar, but not exactly the same. The dataframes all have 59 rows. The dataframe in tab_a and tab_d has 6 columns. The dataframe in tab_b has 1 column, and the dataframe in tab_c has 3 columns. They all contain variants of the same or related data, i.e. the first column (a pseudo index column) is the same in all four dataframes. The dataframe in tab_a has one styling component (a few values in one column can be colored) that is not applied to the other three dataframes.
It is difficult to troubleshoot the issue because it doesn’t occur locally, and I have no access to the server it is deployed on at the moment.
@LukasMasuch Unfortunately this problem still occurs randomly. So I guess it has nothing to do with CSS Styling
Yes I use wide layout and I use “use_container_width=True” too. I met this problem if I use: st.dataframe, st.write(a dataframe) or st.data_editor.
@LukasMasuch yes, Wide layout:
Dataframe is not in a
st.column, but within an anst.tabs.I’m on Chrome Version 123.0.6312.105 (Official Build) (32-bit)
Hey @knoopx and @stefano-brambilla-853558,
Just wanted to follow up that the updates are live as of the latest release 1.32.2. 🥳
Thanks for your valuable input and feedback!
hi, I’m still getting this error with streamlit=1.31.0 Any suggestion on how to proceed?