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
PyScript components become unresponsive on exceptions #1276
If an exception is thrown in the component body of a PyScript component, the component's become unresponsive. This can be demonstrated by using the following pyscript component
fromreactpyimportcomponent, hooks, html@componentdefroot():
count, set_count=hooks.use_state(0)
defincrement(event):
set_count(count+1)
ifcount==5:
raiseValueError("This error both breaks this component's rendering stack, and does not hide the component.")
returnhtml.div(
html.button({"onClick": increment}, "Increment"),
html.p(f"Count: {count}"),
)
Something notable is that this issue only occurs if the exception occurs in the root component. The expected behavior will occur if the exception happens in any child components. For example...
@Archmonger can I work on this? Please assign me this or give me a green flag that no one else is working on this. also it would be great if you can highlight the files/folders which are involved in this bug and might be needed under my scope.
Activity
Prachi-Gupta2808 commentedon Jul 1, 2026
@Archmonger can I work on this? Please assign me this or give me a green flag that no one else is working on this. also it would be great if you can highlight the files/folders which are involved in this bug and might be needed under my scope.
Archmonger commentedon Jul 1, 2026
Sure.
Here is the relevant folder/files:
https://github.com/reactive-python/reactpy/tree/main/src%2Freactpy%2Fexecutors%2Fpyscript
Prachi-Gupta2808 commentedon Jul 3, 2026
@Archmonger I have raised a PR for this, please review this when possible.
Thanks alot.