Skip to content

Commit da944cb

Browse files
committed
fix(ssr): fix memory leak when vnode component render throws error
fix #3100
1 parent 2b588cf commit da944cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/runtime-core/src/componentRenderUtils.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {
1010
Comment,
1111
cloneVNode,
1212
VNodeArrayChildren,
13-
isVNode
13+
isVNode,
14+
blockStack
1415
} from './vnode'
1516
import { handleError, ErrorCodes } from './errorHandling'
1617
import { PatchFlags, ShapeFlags, isOn, isModelListener } from '@vue/shared'
@@ -201,6 +202,7 @@ export function renderComponentRoot(
201202
result = root
202203
}
203204
} catch (err) {
205+
blockStack.length = 0
204206
handleError(err, instance, ErrorCodes.RENDER_FUNCTION)
205207
result = createVNode(Comment)
206208
}

0 commit comments

Comments
 (0)