Streamlit-aggrid crashing my streamlit application

+1 to Snehanā€™s suggestion. Also, are you running this locally or on Streamlit Cloud?

I am running this in my local machine.

@sakshams1990 are you seeing any error messages?

@Caroline
There is no error message seen. It starts with the message of connecting and disconnects after sometime.

I am using the code below with the following versions and the web app crashed.
The change I also notice that, dataframe is not coming with the scroller frame but all rows on the same page.

streamlit==1.13.0
streamlit-aggrid==0.3.3
Dataset

@st.cache(allow_output_mutation=True)
def load_data(filepath):
    return pd.read_csv(filepath)

df = load_data(filepath)
#df = df.iloc[:1000]
st.header("Data Sample.")
st.dataframe(df)
st.info(f"{len(df)}")


AgGrid(df)
st.info("Ag grid above")

@AvratanuBiswas any suggestions ?

Hi @Sarwar_Hayat1 ,

Hereā€™s the demo app in action. For me it seems to work as expected. You can find more about the versions in the same repo and explaination in the related video .

Happy Streamlit-ing :balloon:
Avra

Iā€™ve seen on streamlit forums that others have experienced similar phantom page resets where they did not use ag-grid so Iā€™m thinking this appears to be a streamlit issue rather than ag-grid?

Regardless of update_mode (ā€˜GRID_UPDTAEā€™, ā€˜VALUE_UPDATEā€™, ā€˜MANUALā€™ā€¦) the experience is the same. I have also looked everywhere and tried all types of different variations of settingsā€¦same issue

Upon refresh of the grid, at RANDOM, the entire page will fully refresh and widgets reset, thus the last update to the grid does not get saved to backend. My users no longer can use the grid because it is not reliable. They update a bunch of rows, and after clicking ā€œupdateā€ the page does a full refresh and all their inputs are NOT saved.

I canā€™t find any solution or reason to this random refresh issue

I have the same problem, after starting the streamlit application, it stops by itself, if I remove the import, the application works normally.

1 Like

I got it to work, it just has to be the first library to be imported!

1 Like

I have also been having issues with an app hosted on Streamlit Cloud for about a week.
This app uses an st.aggrid.agGrid component.

It has been running for more than a year on Streamlit Cloud without issues, was update a few times, with the latest update on December 8, 2022.
It started having that erratic behavior last week, while no change has been made to the code.

If I, as the developer, open a session with the cloud hosted app, I see no error (I am the developer and authenticate via Github).

If authorized users open a session, the app has an erratic behavior where it is constantly reloading and displaying errors related to the agGrid front-end component (users authenticate via SSO in our Streamlit Cloud account).

The app uses Streamlit streamlit == 1.15.2 and streamlit-aggrid ==0.3.3 and I import the following items:

from st_aggrid import AgGrid, GridUpdateMode, AgGridReturn, ColumnsAutoSizeMode
from st_aggrid.grid_options_builder import GridOptionsBuilder

I also tried updating streamlit to 1.16.0, which didnā€™t solve the problemā€¦

Also, the app works fine locally on my laptop ad well as on a local server I use for staging, where it works fine for any user (but where there is no authentication required as it is only in our VPN). So this looks definitely related to the Streamlit Cloud deployment.

Users get this type of error:
image

1 Like

The issue I had was related to a feature in Streamlit Cloud platform, not streamlit-aggrid. Streamlit Cloud team disabled the problematic feature, which solved the issue.

1 Like

It works for me, thanks!

How did you get the feature disabled? I am having a similar problem with st_aggrid on Streamlit Cloud

I contacted Streamlit cloud support team (support@streamlit.io). The issue was on their side and they are the ones who disabled the feature that was causing the issueā€¦

Hi, do you know which feature they disabled to fix your issue? thanks! @bkandel

HI Moe, unfortunately I donā€™t know the details of what they did to fix thisā€¦

Hey all, Iā€™m checking with our team to see if the feature that was causing the issue is still active. Iā€™ll let you know when I have an update

1 Like

Thank you bkandel! I found that my issue is not related to the aggrid and it was solved.

Hey all, I checked with our team and the feature in question has not changed, so that wouldnā€™t be causing the issue here.

Hi folks, Iā€™m having the same issue when I deploy my app in AWS fargate (local it never happens). It also works sometimes. It is not just with this component, though. I have on the same page an aggrid and a streamlit-tree-select. It seems they are both trying to find a .js, but canā€™t find it. The name of the js is the same for both, so Iā€™m assuming this is a streamlit-related js and not component-specific (maybe the assumption is wrong, Iā€™m not a web dev, so I apologize in advance :smile: )
I pattern I identified is that the error is most likely to occur (almost 100% of the cases) when I have more than one browse tabs with the app open.