KeyError (only in terminal) when accessing session_state key in a multipage app #8700
Closed
3 of 4 tasks
Labels
feature:multipage-apps
feature:st.session_state
status:cannot-reproduce
Bug cannot be reproduced by the Streamlit team
type:bug
Something isn't working
Checklist
Summary
I have encountered an issue when using
st.session_state
in a multipage Streamlit app. The app runs without any errors in the browser, and I can successfully access and modify thest.session_state
values. However, in the terminal where I run the app, I get aKeyError
indicating that the key is missing fromst.session_state
.Reproducible Code Example
No response
Steps To Reproduce
Create a Streamlit app with the following directory structure
├── app.py
└── pages
└── mypage.py
In
app.py
, add the following code:mypage.py
, add the following code:streamlit run app.py
mypage.py
in the browser.Expected Behavior
The terminal should not display any
KeyError
Current Behavior
The app runs fine in the browser, and
my_val
increments as expected when navigating between pages.However, the terminal displays a
KeyError
indicating that the key "my_val" is missing fromst.session_state
.Is this a regression?
Debug info
Additional Information
No response
The text was updated successfully, but these errors were encountered: