@@ -35,6 +35,7 @@ import { isPromise } from '../utils/promises';
3535import type { ValueOrPromise } from '../utils/types' ;
3636import { assertDefined } from '../error/assert' ;
3737import type { Container } from '../types' ;
38+ import { VNodeFlags } from '../../client/types' ;
3839
3940const DEBUG = false ;
4041
@@ -142,6 +143,14 @@ export function walkCursor(cursor: Cursor, options: WalkOptions): void {
142143 continue ;
143144 }
144145
146+ // Skip if the vNode is deleted
147+ if ( currentVNode . flags & VNodeFlags . Deleted ) {
148+ // Clear dirty bits and move to next node
149+ currentVNode . dirty &= ~ ChoreBits . DIRTY_MASK ;
150+ setCursorPosition ( container , cursor , getNextVNode ( currentVNode ) ) ;
151+ continue ;
152+ }
153+
145154 let result : ValueOrPromise < void > | undefined ;
146155 try {
147156 // Execute chores in order
@@ -179,18 +188,17 @@ export function walkCursor(cursor: Cursor, options: WalkOptions): void {
179188 DEBUG && console . warn ( 'walkCursor: blocking promise' , currentVNode . toString ( ) ) ;
180189 // Store promise on cursor and pause
181190 setVNodePromise ( cursor , result ) ;
182- // pauseCursor(cursor, currentVNode);
183191
192+ const host = currentVNode ;
184193 result
185194 . catch ( ( error ) => {
186195 setVNodePromise ( cursor , null ) ;
187- container . handleError ( error , currentVNode ) ;
196+ container . handleError ( error , host ) ;
188197 } )
189198 . finally ( ( ) => {
190199 setVNodePromise ( cursor , null ) ;
191200 triggerCursors ( ) ;
192201 } ) ;
193- return ;
194202 }
195203 }
196204 finishWalk ( container , cursor , isServer ) ;
0 commit comments