Skip to content
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

Uncatchable Errors when component is unmounted asynchronously #423

Open
oscarleonnogales opened this issue Apr 3, 2023 · 1 comment
Open

Comments

@oscarleonnogales
Copy link
Contributor

oscarleonnogales commented Apr 3, 2023

We have identified a few errors that zoid throws that cannot be caught by the implementation code (render.catch() and close.catch()). If the container element is removed from the DOM or the user is navigating away from the page mid-render, we should avoid throwing errors.

Here are 3 examples:
https://github.com/krakenjs/zoid/blob/main/src/parent/parent.js#L857
https://github.com/krakenjs/zoid/blob/main/src/parent/parent.js#L826
https://github.com/krakenjs/zoid/blob/main/src/parent/parent.js#L1172

These 3 error flows eventually cause the promise to be rejected since the render was never completed, and an error to be displayed on the console: https://github.com/krakenjs/zoid/blob/main/src/parent/parent.js#L732

Would adding additional checks to prevent an error from being thrown be sufficient?

@mdentremont
Copy link

mdentremont commented Apr 4, 2023

Looks like some of this may have been started and then abandoned here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants