Skip to content

Commit 226de00

Browse files
sfc-gh-bniscoclaude
andcommitted
feat(gh-16281): add repro for st.status on a container outside a fragment
Reproduce the "Cannot set a node at a delta path" crash where a fragment calls .status() on a container declared outside the fragment and then opens that status with two separate `with` statements. Verified on 1.60.0. The crashing case sits behind a checkbox because the crash blanks the whole page, and the issue explorer execs the repro inline, so an ungated crash would take the explorer's own UI down with it. The analysis stays in the GitHub issue rather than being duplicated here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent fc09872 commit 226de00

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

issues/gh-16281/app.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""Reproduction for GitHub Issue #16281
2+
Title: `st.status` created on a container outside a fragment corrupts the element
3+
tree and crashes the app with "Cannot set a node at a delta path"
4+
URL: https://github.com/streamlit/streamlit/issues/16281
5+
6+
Expected: A fragment can open a status created on an outside container with two
7+
separate `with` statements, as it can with one created inside.
8+
Actual: The page goes blank and the console logs
9+
`Uncaught Error: Cannot set a node at a delta path`.
10+
Reported version: 1.60.0 (regression, works on 1.58.0, broken since 1.59.0)
11+
"""
12+
13+
import streamlit as st
14+
15+
st.title("Issue #16281: `st.status` on an outside container crashes the app")
16+
st.info("🔗 [View original issue](https://github.com/streamlit/streamlit/issues/16281)")
17+
18+
st.error(
19+
"**Bug:** with the box below checked, the app area goes blank and the browser "
20+
"console logs `Uncaught Error: Cannot set a node at a delta path`. Open the "
21+
"developer console before checking it, then reload the page to recover."
22+
)
23+
st.caption("The crash is behind a checkbox because it blanks the whole page, including the issue explorer's own UI.")
24+
25+
if st.checkbox("Run the crashing repro"):
26+
27+
@st.fragment
28+
def frag(outside):
29+
block = outside.status("query")
30+
with block:
31+
st.code("first")
32+
with block: # second, separate `with` on the same status block
33+
st.text("second")
34+
35+
frag(st.container())

0 commit comments

Comments
 (0)