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
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...
Current Situation
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
This is strange since
layout.py
defines that components should hide themselves when exceptions occur, and that's clearly not happening.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...
Proposed Actions
Figure out why this behavior exists. Perhaps it also exists in server-side components and we just haven't noticed until now?
The text was updated successfully, but these errors were encountered: