1
1
/** @file Public APIs for the SSR */
2
2
3
3
import { assertTrue } from '../shared/error/assert' ;
4
+ import { QError , qError } from '../shared/error/error' ;
5
+ import { ERROR_CONTEXT , isRecoverable } from '../shared/error/error-handling' ;
4
6
import { getPlatform } from '../shared/platform/platform' ;
5
7
import type { QRL } from '../shared/qrl/qrl.public' ;
6
- import { ERROR_CONTEXT , isRecoverable } from '../shared/error/error-handling' ;
7
- import type { ContextId } from '../use/use-context' ;
8
+ import { ChoreType } from '../shared/scheduler' ;
9
+ import { _SharedContainer } from '../shared/shared-container' ;
10
+ import { inflateQRL , parseQRL , wrapDeserializerProxy } from '../shared/shared-serialization' ;
11
+ import { QContainerValue , type HostElement , type ObjToProxyMap } from '../shared/types' ;
8
12
import { EMPTY_ARRAY } from '../shared/utils/flyweight' ;
9
13
import {
10
14
ELEMENT_PROPS ,
11
15
ELEMENT_SEQ ,
12
16
ELEMENT_SEQ_IDX ,
13
- getQFuncs ,
14
17
OnRenderProp ,
15
- Q_PROPS_SEPARATOR ,
16
18
QBaseAttr ,
17
19
QContainerAttr ,
18
20
QContainerSelector ,
@@ -23,19 +25,18 @@ import {
23
25
QStyle ,
24
26
QStyleSelector ,
25
27
QSubscribers ,
28
+ Q_PROPS_SEPARATOR ,
26
29
USE_ON_LOCAL_SEQ_IDX ,
30
+ getQFuncs ,
27
31
} from '../shared/utils/markers' ;
28
32
import { isPromise } from '../shared/utils/promises' ;
29
33
import { isSlotProp } from '../shared/utils/prop' ;
30
34
import { qDev } from '../shared/utils/qdev' ;
31
- import { ChoreType } from '../shared/scheduler' ;
32
35
import {
33
36
convertScopedStyleIdsToArray ,
34
37
convertStyleIdsToString ,
35
38
} from '../shared/utils/scoped-styles' ;
36
- import { _SharedContainer } from '../shared/shared-container' ;
37
- import { inflateQRL , parseQRL , wrapDeserializerProxy } from '../shared/shared-serialization' ;
38
- import { QContainerValue , type HostElement , type ObjToProxyMap } from '../shared/types' ;
39
+ import type { ContextId } from '../use/use-context' ;
39
40
import { processVNodeData } from './process-vnode-data' ;
40
41
import {
41
42
VNodeFlags ,
@@ -65,7 +66,6 @@ import {
65
66
vnode_setProp ,
66
67
type VNodeJournal ,
67
68
} from './vnode' ;
68
- import { QError , qError } from '../shared/error/error' ;
69
69
70
70
/** @public */
71
71
export function getDomContainer ( element : Element | VNode ) : IClientContainer {
@@ -190,7 +190,7 @@ export class DomContainer extends _SharedContainer implements IClientContainer {
190
190
}
191
191
192
192
handleError ( err : any , host : HostElement ) : void {
193
- if ( qDev ) {
193
+ if ( qDev && host ) {
194
194
// Clean vdom
195
195
if ( typeof document !== 'undefined' ) {
196
196
const vHost = host as VirtualVNode ;
@@ -215,7 +215,7 @@ export class DomContainer extends _SharedContainer implements IClientContainer {
215
215
throw err ;
216
216
}
217
217
}
218
- const errorStore = this . resolveContext ( host , ERROR_CONTEXT ) ;
218
+ const errorStore = host && this . resolveContext ( host , ERROR_CONTEXT ) ;
219
219
if ( ! errorStore ) {
220
220
throw err ;
221
221
}
0 commit comments