Skip to content

Prevent JavaScript components from crashing ReactPy by adding error boundaries #676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Archmonger opened this issue Feb 17, 2022 · 4 comments
Labels
priority-2-moderate Should be resolved on a reasonable timeline. type-revision About a change in functionality or behavior

Comments

@Archmonger
Copy link
Contributor

Archmonger commented Feb 17, 2022

Current Situation

Currently, if an invalid hook call occurs then ReactPy completely breaks.

Reference

Proposed Actions

Add an error boundary to tree nodes to prevent complete failure upon tree exceptions. Probably only want to apply this to things that have been exported via module_from_template(...). We have no reason to assume this exception can happen with any pure ReactPy code.

@Archmonger Archmonger added priority-3-low May be resolved one any timeline. type-revision About a change in functionality or behavior labels Feb 17, 2022
@Archmonger Archmonger added this to the 2.0 milestone Feb 17, 2022
@Archmonger
Copy link
Contributor Author

Archmonger commented Mar 25, 2022

I've had this happen once again, despite pinned versions of react bootstrap.
I'm still not entirely sure why this occurs.

A potential solution is naming the files on disk based on a calculated hash, rather than NPM package name.

@Archmonger
Copy link
Contributor Author

Archmonger commented Mar 25, 2022

Since this can break idom until the user clears his browser cache, I'm going to change the priority/milestone for this.

@Archmonger Archmonger modified the milestones: 2.0, 1.0 Mar 25, 2022
@Archmonger Archmonger added priority-2-moderate Should be resolved on a reasonable timeline. and removed priority-3-low May be resolved one any timeline. labels Mar 25, 2022
@Archmonger
Copy link
Contributor Author

Archmonger commented Apr 4, 2022

@rmorshea This seems to be almost a weekly breaking issue for me, assuming that I'm not clearing cache on each page load.

The only way I've found to replicate this issue is very artificial and I'd almost expect it to fail. The less consistent but more realistic way involves me just waiting for it to randomly happen.

@Archmonger
Copy link
Contributor Author

Archmonger commented Apr 16, 2022

Related to:

@Archmonger Archmonger modified the milestones: 1.0, 2.0 Sep 15, 2022
@Archmonger Archmonger modified the milestones: Luxury, Essential Jan 29, 2023
@rmorshea rmorshea removed this from the Essential milestone Feb 21, 2023
@Archmonger Archmonger changed the title Prevent exports from breaking IDOM by adding error boundaries Prevent JavaScript components from crashing ReactPy by adding error boundaries Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-2-moderate Should be resolved on a reasonable timeline. type-revision About a change in functionality or behavior
Projects
None yet
Development

No branches or pull requests

2 participants