Skip to content
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

streamlit update to 1.32.1 onwards, sac.menu issue #53

Open
wyzdic opened this issue Apr 15, 2024 · 4 comments
Open

streamlit update to 1.32.1 onwards, sac.menu issue #53

wyzdic opened this issue Apr 15, 2024 · 4 comments

Comments

@wyzdic
Copy link

wyzdic commented Apr 15, 2024

I'm using Streamlit-Authenticator at the same time, sac.menu doesn't show up after logging in, it's the same effect when I refresh the browser, if I click R to refresh the page to show up, I downgrade streamlit to 1.32 everything works fine, I've tried 1.32.1/1.32.2/1.33 all the same problem

@wyzdic
Copy link
Author

wyzdic commented Apr 15, 2024

Additional note: I use edge and have tried multiple versions with the same issue

@dscain
Copy link

dscain commented Aug 6, 2024

I am facing the same issue. I have noticed that when I save the file with runOnSave=true, the page will dynamically rerun and then the menu will appear. I am guessing there is something with fragment rerun, but the way the authenticator uses the sidebar generates an error with st.sidebar.

@dscain
Copy link

dscain commented Aug 6, 2024

Indeed, I just added this code after the menu creation and now the menu shows. I haven't fully tested everything yet but the menu is there.

menuSelection = sac.menu(menuMain, open_all=True)

if ("shouldRerun" not in st.session_state):
    st.session_state["shouldRerun"] = False
    st.rerun()

@wyzdic
Copy link
Author

wyzdic commented Aug 20, 2024

After testing, it was found that the problem was caused by extra_streamlit_components component. If you are also using Streamlit-Authenticator and streamlit==1.37, you can use the following code to fix it
Modify Streamlit_Authenticator/models/cookie_model.py
Comment: # self.token = self.cookie_manager.get(self.cookie_name)
Modified to (streamlit==1.37)
if st.context.cookies.get("stauth_cookie"):
self.token = st.context.cookies["stauth_cookie"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants