@@ -89,7 +89,7 @@ import {
89
89
type ElementVNode ,
90
90
type VirtualVNode ,
91
91
} from '../client/types' ;
92
- import { VNodeJournalOpCode , vnode_isVNode , vnode_locate , vnode_setAttr } from '../client/vnode' ;
92
+ import { VNodeJournalOpCode , vnode_isVNode , vnode_setAttr } from '../client/vnode' ;
93
93
import { vnode_diff } from '../client/vnode-diff' ;
94
94
import { triggerEffects , type ComputedSignal , type WrappedSignal } from '../signal/signal' ;
95
95
import { isSignal , type Signal } from '../signal/signal.public' ;
@@ -99,7 +99,7 @@ import { runResource, type ResourceDescriptor } from '../use/use-resource';
99
99
import { Task , TaskFlags , cleanupTask , runTask , type TaskFn } from '../use/use-task' ;
100
100
import { executeComponent } from './component-execution' ;
101
101
import type { OnRenderFn } from './component.public' ;
102
- import { assertEqual } from './error/assert' ;
102
+ import { assertEqual , assertFalse } from './error/assert' ;
103
103
import type { Props } from './jsx/jsx-runtime' ;
104
104
import type { JSXOutput } from './jsx/types/jsx-node' ;
105
105
import { type QRLInternal } from './qrl/qrl-class' ;
@@ -214,7 +214,7 @@ export const createScheduler = (
214
214
) : ValueOrPromise < void > ;
215
215
function schedule (
216
216
type : ChoreType . RUN_QRL ,
217
- host : Element ,
217
+ host : HostElement ,
218
218
target : QRLInternal < ( ...args : unknown [ ] ) => unknown > ,
219
219
args : unknown [ ]
220
220
) : ValueOrPromise < void > ;
@@ -240,7 +240,7 @@ export const createScheduler = (
240
240
///// IMPLEMENTATION /////
241
241
function schedule (
242
242
type : ChoreType ,
243
- hostOrTask : HostElement | Task | Element | null = null ,
243
+ hostOrTask : HostElement | Task | null = null ,
244
244
targetOrQrl : ChoreTarget | string | null = null ,
245
245
payload : any = null
246
246
) : ValueOrPromise < any > {
@@ -436,11 +436,7 @@ export const createScheduler = (
436
436
qrlRuns . splice ( qrlRuns . indexOf ( handled ) , 1 ) ;
437
437
} )
438
438
. catch ( ( error ) => {
439
- // TODO test this
440
- const host = isDomContainer ( container )
441
- ? vnode_locate ( container . rootVNode , chore . $host$ as any as Element )
442
- : null ! ;
443
- container . handleError ( error , host ) ;
439
+ container . handleError ( error , chore . $host$ ) ;
444
440
} ) ;
445
441
// Don't wait for the promise to resolve
446
442
// TODO come up with a better solution, we also want concurrent signal handling with tasks but serial tasks
@@ -578,6 +574,8 @@ export const createScheduler = (
578
574
return hostDiff ;
579
575
}
580
576
} else {
577
+ assertFalse ( vnode_isVNode ( aHost ) , 'expected aHost to be SSRNode but it is a VNode' ) ;
578
+ assertFalse ( vnode_isVNode ( bHost ) , 'expected bHost to be SSRNode but it is a VNode' ) ;
581
579
// we are running on the server.
582
580
// On server we can't schedule task for a different host!
583
581
// Server is SSR, and therefore scheduling for anything but the current host
0 commit comments