#11367·streamlit

Bug st.toast breaks the app when executed from a callback

Author: injenieroCreated May 15, 2025Updated Sep 16, 2026
Labelstype:bugstatus:confirmedpriority:P3feature:st.toastfeature:st.dialog

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

st.toast breaks the app when executed from a callback within a dialogue.

Reproducible Code Example

import streamlit as st

def on_click_callback():
    st.toast("This is a toast notification!", icon="")

@st.dialog(title="Streamlit Toast Notification", width="large")
def toast_notification():
   st.markdown("## Toast Notification")
   st.button("Show Toast", on_click=on_click_callback)

if st.button("Show Dialogue"):
    toast_notification()

Steps To Reproduce

click the button to show the dialogue, then click on the button on the dialogue

Expected Behavior

It should not break the app

Current Behavior

It render the page white and the JS console shows

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.45.0
  • Python version: 3.11.11
  • Operating System: macos
  • Browser: Chrome

Additional Information

No response