-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad message format: setIn
cannot be called on an ElementNode
#3223
Comments
I faced the same issue while showing a PyDeck map in a pre-allocated space. I was able to circumvent the issue by not using Issue was observed with this code:
Issue was circumvented with this code:
|
Thanks for the issue @snehankekre ! I'm hoping this gets resolved in our updated version of Session State! Marking it to be tested when we release the feature. |
Gentle Bump, @kmcgrady Just encountered the same issue on Streamlit v0.84.0 using the new native st.session_state |
Same issue here and urgently need a fix. Getting this issue when generating beta_columns on Streamlit v0.84.0. |
So I've fixed it for myself. The issue in my case was that i was trying to pass a container to the callback so i can display an alert. The problem is that, the container is not created yet in the context of the new run. (Since the order of execution of when using callbacks calls the callback first thing, then executes the rest of the app). |
Hi @leJOEndary and @LukasHaas Thanks for your insights. I think that lines up. Callbacks were designed to manipulate session state and not change the display of the app. If you would like to display something, you can set a flag in Session State and then update the script to check the flag and display what you need. def check_valid():
# where "is not valid" the check you need.
st.session_state.show_error = st.session_state.text is not valid
st.text_input("Enter text", on_change=check_valid, key="text")
if st.session_state.show_error:
st.warning("Warning Warning!") Let me know if that helps. If you have a small sample code example that demonstrates the issue, that would be helpful! |
@kmcgrady Yeah, thank you for the reply. Here's a super simplified version of what I was trying to do which resulted in the exception.
After i changed it to:
Things worked again 😄 |
Closing, this is apparently using the old SessionState hack and seems to be resolved with |
This problem still exists. I did something similar to the OP and got the exact same error. I'm on st v.1.26.0 |
As @ibehnam said, this problem still exist and I had similar problem today |
@jrieke Can this be reopened? This is still an issue for me, v=1.29.0 |
This is still an issue on 1.33.0. I get it consistently on the usage of radio selections within an st.empty |
This is still an issue, got it today |
Got this same issue today |
Summary
Running the below app and clicking on a button to delete entries as shown in the gif causes the following browser alert to be displayed: Bad message format: 'setIn' cannot be called on an ElementNode
Steps to reproduce
Run the app and delete an entry in the sidebar, as shown in the below gif.
$ streamlit run https://gist.githubusercontent.com/mihirsamdarshi/4650e8041954e3fb5e629e71beaf40c3/raw/9a9b0817f8c09ca4529dc41210f3c6e37fe567fe/streamlit_set_in_bug.py
Code snippet:
Expected behavior:
No alert should be displayed in the browser.
Actual behavior:
Browser alter with the specific message is displayed: Bad message format: 'setIn' cannot be called on an ElementNode
Is this a regression?
no
Debug info
Additional information
Bug first mentioned in the forum: https://discuss.streamlit.io/t/ignore-an-alert-bad-message-format/9913
The text was updated successfully, but these errors were encountered: