Skip to content

Fix #36 cosmetic MemoryCache warning at CLI startup#38

Open
NetZissou wants to merge 1 commit into
mainfrom
fix/suppress-memorycache-warning
Open

Fix #36 cosmetic MemoryCache warning at CLI startup#38
NetZissou wants to merge 1 commit into
mainfrom
fix/suppress-memorycache-warning

Conversation

@NetZissou

Copy link
Copy Markdown
Collaborator

Streamlit 1.58 emits "No runtime found, using MemoryCacheStorageManager" when @st.cache_data is decorated (at import) without a runtime. The CLI lancher imports the app module to reach main() before the server runtime exists, so importing any cache-decorated component warns.

The @st.cache_data is a Streamlit decorator, it eagerly initializes a cache-storage manager, which is looking for a runtime.

Breakdown sequence:

entry point reach main ->
importing the app modules ->
top-level imports pull in those cache-decorated component modules ->
decoration ran in the bare launcher process (no runtime) ->
warning

The fix move component imports into app() in both applications so the launcher process never touches @st.cache_data decorator. The real server runs app() under a live Streamlit runtime.

Streamlit 1.58 emits "No runtime found, using MemoryCacheStorageManager"
when `@st.cache_data` is decorated (at import) without a runtime. The
CLI lancher imports the app module to reach `main()` before the server
runtime exists, so importing any cache-decorated component warns.

The @st.cache_data is a Streamlit decorator, it eagerly initializes a
cache-storage manager, which is looking for a runtime.

Breakdown sequence:
```
entry point reach main ->
importing the app modules ->
top-level imports pull in those cache-decorated component modules ->
decoration ran in the bare launcher process (no runtime) ->
warning
```

The fix move component imports into `app()` in both applications so the
launcher process never touches `@st.cache_data` decorator. The real
server runs `app()` under a live Streamlit runtime.
@NetZissou NetZissou requested a review from egrace479 June 12, 2026 13:16
@NetZissou NetZissou self-assigned this Jun 12, 2026
@NetZissou NetZissou added the bug Something isn't working label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppress No runtime found, using MemoryCacheStorageManager warning at CLI startup

1 participant