solid icon indicating copy to clipboard operation
solid copied to clipboard

throwing in onCleanup callback breaks reactivity

Open mizulu opened this issue 7 months ago • 1 comments

Describe the bug

throwing in onCleanup breaks reactivity

For example a <Comp> is conditionally rendered and it has a cleanup hook when the <Show> condition become falsy, the <Comp/> cleanup will be called and if the callback throws an exception, the dom update will fail, and application state will be broken.

Your Example Website or App

https://playground.solidjs.com/anonymous/2d9028af-fa5d-489a-a84f-9a571b7a44d6

Steps to Reproduce the Bug or Issue

see reproduction playground link

Expected behavior

throwing in onCleanup callback should not break application reactivity.

additional consideration is that users might still want to see the exception

Screenshots or Videos

No response

Platform

playground

Additional context

No response

mizulu avatar May 26 '25 18:05 mizulu

Yeah this is a good point and require some refactoring of the core reactivity to handle better. I might not touch this in 1.0 time period but we've already addressed this in 2.0.

ryansolid avatar Aug 06 '25 21:08 ryansolid