Ignore an alert: 'Bad message format'

Here is another interesting case I encountered while dev-ing an app. You can see here.

Basically, it had a login form. I used -

form = st.form(key='my-form')
username = form.text_input("Username")
password = form.text_input("Password")
twoFA = form.text_input("2FA")
submit = form.form_submit_button('Submit')

So,

I used this -

text4 = st.empty()
with text4.beta_container():
    st.text('Method 1: Put Your Credentials to log in.')

    form = st.form(key='my-form')
    username = form.text_input("Username")
    password = form.text_input("Password")
    twoFA = form.text_input("2FA")
    submit = form.form_submit_button('Submit')

    submit = False
    st.text('Method 2: Check account positions clicking buttons')
    if st.button("Show me Amit's One Acccount"):
        username = 'S'
        password = 'K@K'
        twoFA='K'
        submit = True

if submit:
    text4.empty()

Basically a hacky solution which is straight forward from the documentation as you can see here -
https://docs.streamlit.io/en/0.82.0/api.html#placeholders-help-and-options

That’s when I landed in the error.

Well, it was just error but it was working correctly after the error but as I was dev-ing production level app, it is quite nightmare actually.