You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rx.toast.dismiss breaks for IDs containing quotes or newlines #8017
rx.toast.dismiss(id: str) inserts the ID directly inside a single-quoted JavaScript string without escaping it. Valid IDs containing an apostrophe or newline produce invalid JavaScript, so the generated event cannot run (and can make the frontend script fail to parse).
Node rejects this with SyntaxError: missing ) after argument list. A newline in the ID also becomes a literal newline inside the quoted string and fails parsing.
Expected behavior
The string ID should be serialized as a valid JavaScript string literal so any supported ID can be passed to rx.toast.dismiss.
Specifics
Verified against current upstream main (6f5c39cac).
The affected code is packages/reflex-components-sonner/src/reflex_components_sonner/toast.py, in Toaster.toast_dismiss.
Additional context
This concerns only the Python str ID branch; the Var[str] branch already emits a variable expression. Existing toast style-prop issues concern different props and do not cover dismissal ID escaping.
Activity
linear-code commentedon Nov 26, 2026
ENG-14973