When hosting my Streamlit app on Google Cloud Run, attempts to select or upload a file sometimes fail silently. Inspecting Chrome’s DevTools “Sources” panel reveals an unhandled promise rejection:
Error: Tried to use SessionInfo before it was initialized
at SessionInfo.get (session_info.ts:45)
at FileUploader.onChange (file_uploader.tsx:102)
…
This only occurs in the Cloud Run deployment—on localhost the file picker always works. It appears that after a reconnect (for example, following a brief idle period or network hiccup), Streamlit’s front-end clears its internal SessionInfo and then never re-initializes it before handling the file‐picker promise.
Steps to reproduce:
- Deploy a basic Streamlit app with a
st.file_uploader
to Cloud Run. - Open the app in Chrome and leave it idle for several minutes (or trigger a network reconnect).
- Attempt to click the file uploader button.
- Observe in DevTools → Console / Sources that an unhandled promise rejection fires with “Tried to use SessionInfo before it was initialized.” The file selection dialog does not appear, and the upload never proceeds.
Expected behavior:
After a reconnect or idle timeout, Streamlit should re‐establish its SessionInfo before handling UI events such as file uploads. The file picker dialog should open reliably, without throwing an error.
Actual behavior:
The front‐end throws an unhandled promise rejection and silently fails to open the file picker. Users must manually reload the page before they can select files again.