File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -204,8 +204,12 @@ export function check_dirtiness(reaction) {
204204 var length = dependencies . length ;
205205
206206 // If we are working with a disconnected or an unowned signal that is now connected (due to an active effect)
207- // then we need to re-connect the reaction to the dependency
208- if ( is_disconnected || is_unowned_connected ) {
207+ // then we need to re-connect the reaction to the dependency, unless the effect has already been destroyed
208+ // (which can happen if the derived is read by an async derived)
209+ if (
210+ ( is_disconnected || is_unowned_connected ) &&
211+ ( active_effect === null || ( active_effect . f & DESTROYED ) === 0 )
212+ ) {
209213 for ( i = 0 ; i < length ; i ++ ) {
210214 dependency = dependencies [ i ] ;
211215
You can’t perform that action at this time.
0 commit comments