Skip to content

Commit 9df995f

Browse files
committed
fix: add SSR check for error-boundary
1 parent 1123ee6 commit 9df995f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/src/workloop/workloop.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,10 @@ function mount(fiber: Fiber, prev: Fiber, $scope: Scope) {
394394

395395
component.children = result as Array<Instance>;
396396
} catch (err) {
397+
const isSSR = detectIsSSR();
398+
397399
if (detectIsPromise(err)) {
398400
const promise = err;
399-
const isSSR = detectIsSSR();
400401
const reset = createResetClosure(fiber, prev, $scope);
401402

402403
if (!isSSR) {
@@ -415,7 +416,7 @@ function mount(fiber: Fiber, prev: Fiber, $scope: Scope) {
415416
}
416417
} else {
417418
component.children = [];
418-
fiber.setError(err);
419+
!isSSR && fiber.setError(err);
419420
}
420421
}
421422
} else if (detectIsVirtualNodeFactory(inst)) {

0 commit comments

Comments
 (0)