Backtestsvuerun-20261007-145226#15070

Issue #15070 Merged fix PR #15071 Run 7 Oct 2026 · run-20261007-145226 vuejs/core

SSR memory leak after a render error in a dynamic component

Better

Our patch was judged better than the merged fix.

In this judgment, Patch A = our agent, Patch B = the merged fix.

Root cause: in SSR, a dynamic component with a slot goes through the vdom `renderSlot`. It calls `openBlock()` and then the slot throws, so `blockStack`/`currentBlock` stay stale. Every vnode created afterwards is then pushed into that orphaned block and retained forever.

Patch A fixes this at two levels:
- **Local fix:** `renderSlot` closes its block on throw and restores `_d`.
- **Boundary fix:** a new `resetBlockTracking()` clears both `blockStack` and `currentBlock`. It is used in `renderComponentRoot`'s catch, which previously cleared only `blockStack.length` and left `currentBlock` dangling, a real latent bug. It is also used in a catch around SSR `renderComponentSubTree`.

The SSR-boundary reset means any other dangling blocks are discarded before the error escapes the render. This includes nested inline blocks such as `v-if` inside the slot, and blocks opened outside a slot. That makes the fix robust beyond the specific reproduction.

Patch A's tests assert the global state directly (`blockStack.length === 0`, `currentBlock === null`) in three places: the unit test for `renderSlot`, the `renderComponentRoot` error path, and the issue's SSR scenario. Each would fail before the change.

Patch A also fixes the unbalanced warning-context push/pop on error. That is extra scope, but low risk.

Patch B also fixes the reported case. It unwinds blocks back to the previous stack depth in `renderSlot` and adds a `finally` in `withCtx` that covers `v-if` inline blocks inside slots. However:
- It leaves the `renderComponentRoot` catch setting only `blockStack.length = 0` with a stale `currentBlock`.
- It has no SSR-level safety net, so dangling blocks outside `withCtx` are not handled.
- It adds a loop to the hot `withCtx` path on every slot invocation.

Patch B's tests are GC/WeakRef based. They are valid but only run in the gc project and are skipped without `--expose-gc`. They are also more indirect and potentially timing-sensitive compared with A's deterministic state assertions.

Overall, A addresses the root cause more completely and has stronger, deterministic tests.

The judge saw only the two patches, labelled A and B in random order, with issue links and version numbers removed. The reasoning above is shown verbatim.

Solve

14m 55s

Wall-clock time in the container

Full test suite

No new failures

3,613 passed · 6 skipped · 3,619 total

Contamination audit

Clean

No sign the agent saw the real fix

Patch size

312vs 152 merged

Changed lines, ours vs merged

Vue version

3.5.39

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-qfkzyzwp?file=leak.mjs

Steps to reproduce

  • download the reproduction from stackblitz (won't work there, needs to be run locally)
  • run pnpm i && pnpm leak
  • see the heap size & alive app instances grow with each request after the single failed render

The script renders 500 fresh SSR apps, which all get garbage-collected. Then renders one app whose slot content throws, then renders 500 more identical healthy apps, which will never be garbage collected afterwards.

A dynamic component <component :is> with a <slot /> is needed for this to reproduce.

Card

<script setup>
    defineProps({ tag: { type: String, default: 'div' } })
</script>

<template>
    <component :is="tag" class="card">
        <slot />
    </component>
</template>

app:

<script setup>
    defineProps(['payload'])  // one request renders with `payload: null` → throws
</script>

<template>
    <main>
        <Card>{{ payload.title }}</Card>
    </main>
</template>

What is expected?

A failed renderToString should not affect subsequent renders and all apps rendered after it should get garbage collected.

What is actually happening?

Every app created after the single failed render is kept in memory forever.

--- phase 1: 500 healthy renders ---
after 500: created=500 finalized=500 alive=0 heap=20.6MB

--- one crashing render (SSR render error) ---
render rejected as expected: Cannot read properties of null (reading 'title')

--- phase 2: 500 healthy renders (identical to phase 1) ---
after 500: created=1001 finalized=500 alive=501 heap=29.0MB

FINAL: created=1001 finalized=500 alive=501

System Info

Any additional comments?

_No response_

The two patches

Our patch+232 −80
packages/runtime-core/__tests__/errorHandling.spec.tsindex 0cd3efa58..d37fbf84d 100644@@ -14,6 +14,7 @@ import {   watchEffect, } from '@vue/runtime-test' import { ErrorCodes, ErrorTypeStrings } from '../src/errorHandling'+import { blockStack, currentBlock, openBlock } from '../src/vnode'  describe('error handling', () => {   test('propagation', () => {@@ -246,6 +247,37 @@ describe('error handling', () => {     expect(fn).toHaveBeenCalledWith(err, 'render function')   }) +  test('in render function: discards blocks left open by the error', () => {+    const err = new Error('foo')+    const fn = vi.fn()++    const Comp = {+      setup() {+        onErrorCaptured((err, instance, info) => {+          fn(err, info)+          return false+        })+        return () => h(Child)+      },+    }++    const Child = {+      setup() {+        return () => {+          // e.g. a slot throwing inside `renderSlot` after `openBlock()`+          openBlock()+          throw err+        }+      },+    }++    render(h(Comp), nodeOps.createElement('div'))+    expect(fn).toHaveBeenCalledWith(err, 'render function')+    expect(blockStack.length).toBe(0)+    // a stale current block would keep collecting every vnode created later+    expect(currentBlock).toBe(null)+  })+   test('in function ref', () => {     const err = new Error('foo')     const ref = () => {packages/runtime-core/__tests__/helpers/renderSlot.spec.tsindex bc0678b51..1ddb307ea 100644@@ -11,6 +11,7 @@ import { } from '../../src' import { PatchFlags } from '@vue/shared' import { setCurrentRenderingInstance } from '../../src/componentRenderContext'+import { blockStack, currentBlock } from '../../src/vnode'  describe('renderSlot', () => {   beforeEach(() => {@@ -69,6 +70,32 @@ describe('renderSlot', () => {     expect(templateRendered.dynamicChildren!.length).toBe(1)   }) +  it('should close its block when the slot throws', () => {+    const slot = withCtx(+      () => {+        throw new Error('slot error')+      },+      // mock instance+      { type: {}, appContext: {} } as any,+    ) as Slot++    // the error is caught by user code and rendering continues+    openBlock()+    expect(() => renderSlot({ default: slot }, 'default')).toThrow(+      'slot error',+    )+    const child = createVNode('div', null, 'foo', PatchFlags.TEXT)+    const parent = createBlock(Fragment, null, [child])+    // the dynamic child created afterwards must be tracked by the enclosing+    // block instead of the block left open by the failed slot+    expect(parent.dynamicChildren).toEqual([child])+    // no block is left open to retain vnodes created later+    expect(blockStack.length).toBe(0)+    expect(currentBlock).toBe(null)+    // the slot's tracking flag is restored, so manual invocation won't track+    expect((slot as any)._d).toBe(true)+  })+   // #2347 #2461   describe('only render valid slot content', () => {     it('should ignore slots that are all comments', () => {packages/runtime-core/src/componentRenderUtils.tsindex 0b46130c0..72dbdaf31 100644@@ -8,11 +8,11 @@ import {   Comment,   type VNode,   type VNodeArrayChildren,-  blockStack,   cloneVNode,   createVNode,   isVNode,   normalizeVNode,+  resetBlockTracking, } from './vnode' import { ErrorCodes, handleError } from './errorHandling' import {@@ -141,7 +141,7 @@ export function renderComponentRoot(         : getFunctionalFallthrough(attrs)     }   } catch (err) {-    blockStack.length = 0+    resetBlockTracking()     handleError(err, instance, ErrorCodes.RENDER_FUNCTION)     result = createVNode(Comment)   }packages/runtime-core/src/helpers/renderSlot.tsindex 2f1296bb1..afb8a8d64 100644@@ -9,6 +9,7 @@ import {   Fragment,   type VNode,   type VNodeArrayChildren,+  closeBlock,   createBlock,   createVNode,   isVNode,@@ -72,7 +73,18 @@ export function renderSlot(     ;(slot as ContextualRenderFn)._d = false   }   openBlock()-  const validSlotContent = slot && ensureValidVNode(slot(props))+  let validSlotContent: VNodeArrayChildren | null | undefined+  try {+    validSlotContent = slot && ensureValidVNode(slot(props))+  } catch (err) {+    // close the block opened above, otherwise the stale `currentBlock` would+    // keep collecting (and retaining) every vnode created afterwards+    closeBlock()+    if (slot && (slot as ContextualRenderFn)._c) {+      ;(slot as ContextualRenderFn)._d = true+    }+    throw err+  }   const slotKey =     props.key ||     // slot content array of a dynamic conditional slot may have a branchpackages/runtime-core/src/index.tsindex 792a28b25..9d3266cce 100644@@ -401,7 +401,7 @@ import { } from './component' import { renderComponentRoot } from './componentRenderUtils' import { setCurrentRenderingInstance } from './componentRenderContext'-import { isVNode, normalizeVNode } from './vnode'+import { isVNode, normalizeVNode, resetBlockTracking } from './vnode' import { ensureValidVNode } from './helpers/renderSlot' import { popWarningContext, pushWarningContext } from './warning' @@ -416,6 +416,7 @@ const _ssrUtils: {   ensureValidVNode: typeof ensureValidVNode   pushWarningContext: typeof pushWarningContext   popWarningContext: typeof popWarningContext+  resetBlockTracking: typeof resetBlockTracking } = {   createComponentInstance,   setupComponent,@@ -427,6 +428,7 @@ const _ssrUtils: {   ensureValidVNode,   pushWarningContext,   popWarningContext,+  resetBlockTracking, }  /**packages/runtime-core/src/vnode.tsindex b4fe6f237..afb3fa1eb 100644@@ -290,6 +290,17 @@ export function closeBlock(): void {   currentBlock = blockStack[blockStack.length - 1] || null } +/**+ * Discard any blocks left open by a render that threw before reaching+ * `createBlock`. Otherwise the stale `currentBlock` would keep collecting (and+ * retaining) every vnode created afterwards.+ * @internal+ */+export function resetBlockTracking(): void {+  blockStack.length = 0+  currentBlock = null+}+ // Whether we should be tracking dynamic child nodes inside a block. // Only tracks when this value is > 0 // We are not using a simple boolean because this value may need to bepackages/server-renderer/__tests__/ssrDynamicComponent.spec.tsindex 0679c8216..8cb4c2e76 100644@@ -1,5 +1,6 @@-import { createApp, createVNode } from 'vue'+import { createApp, createVNode, warn } from 'vue' import { renderToString } from '../src'+import { blockStack, currentBlock } from '../../runtime-core/src/vnode'  describe('ssr: dynamic component', () => {   test('resolved to component', async () => {@@ -77,4 +78,55 @@ describe('ssr: dynamic component', () => {       ),     ).toBe(`<div id="test"><span>slot</span></div>`)   })++  // a render error thrown from slot content of a dynamic component must not+  // leave a block open, otherwise all vnodes created by subsequent renders get+  // collected into it and are never garbage collected+  test('render error in slot content does not leak into subsequent renders', async () => {+    const Card = {+      props: { tag: { type: String, default: 'div' } },+      template: `<component :is="tag" class="card"><slot /></component>`,+    }+    const createRoot = (payload: { title: string } | null) =>+      createApp(+        {+          components: { Card },+          props: ['payload'],+          template: `<main><Card>{{ payload.title }}</Card></main>`,+        },+        { payload },+      )++    await expect(renderToString(createRoot(null))).rejects.toThrow(+      `Cannot read properties of null`,+    )+    expect(blockStack.length).toBe(0)+    expect(currentBlock).toBe(null)++    expect(await renderToString(createRoot({ title: 'hi' }))).toBe(+      `<main><div class="card"><!--[-->hi<!--]--></div></main>`,+    )+    expect(blockStack.length).toBe(0)+    expect(currentBlock).toBe(null)+  })++  test('render error does not leave a stale warning context', async () => {+    const Failing = {+      template: `<component is="div"><slot /></component>`,+    }+    const app = createApp({+      components: { Failing },+      data: () => ({ payload: null }),+      template: `<Failing>{{ payload.title }}</Failing>`,+    })+    const warnHandler = vi.fn()+    app.config.warnHandler = warnHandler+    await expect(renderToString(app)).rejects.toThrow()++    // a warning issued outside of any component must not be attributed to+    // (and routed to the warn handler of) the app whose render failed+    warn('outside of component')+    expect('outside of component').toHaveBeenWarned()+    expect(warnHandler).not.toHaveBeenCalled()+  }) })packages/server-renderer/src/render.tsindex 8fc9b0128..4355fff8d 100644@@ -38,6 +38,7 @@ const {   normalizeVNode,   pushWarningContext,   popWarningContext,+  resetBlockTracking, } = ssrUtils  export type SSRBuffer = SSRBufferItem[] & { hasAsync?: boolean }@@ -100,8 +101,12 @@ export function renderComponentVNode(     null,   ))   if (__DEV__) pushWarningContext(vnode)-  const res = setupComponent(instance, true /* isSSR */)-  if (__DEV__) popWarningContext()+  let res+  try {+    res = setupComponent(instance, true /* isSSR */)+  } finally {+    if (__DEV__) popWarningContext()+  }   const hasAsyncSetup = isPromise(res)   let prefetches = instance.sp /* LifecycleHooks.SERVER_PREFETCH */   if (hasAsyncSetup || prefetches) {@@ -130,94 +135,105 @@ function renderComponentSubTree(   if (__DEV__) pushWarningContext(instance.vnode)   const comp = instance.type as Component   const { getBuffer, push } = createBuffer()-  if (isFunction(comp)) {-    let root = renderComponentRoot(instance)-    // #5817 scope ID attrs not falling through if functional component doesn't-    // have props-    if (!(comp as FunctionalComponent).props) {-      for (const key in instance.attrs) {-        if (key.startsWith(`data-v-`)) {-          ;(root.props || (root.props = {}))[key] = ``+  try {+    if (isFunction(comp)) {+      let root = renderComponentRoot(instance)+      // #5817 scope ID attrs not falling through if functional component+      // doesn't have props+      if (!(comp as FunctionalComponent).props) {+        for (const key in instance.attrs) {+          if (key.startsWith(`data-v-`)) {+            ;(root.props || (root.props = {}))[key] = ``+          }         }       }-    }-    renderVNode(push, (instance.subTree = root), instance, slotScopeId)-  } else {-    if (-      (!instance.render || instance.render === NOOP) &&-      !instance.ssrRender &&-      !comp.ssrRender &&-      isString(comp.template)-    ) {-      comp.ssrRender = ssrCompile(comp.template, instance)-    }+      renderVNode(push, (instance.subTree = root), instance, slotScopeId)+    } else {+      if (+        (!instance.render || instance.render === NOOP) &&+        !instance.ssrRender &&+        !comp.ssrRender &&+        isString(comp.template)+      ) {+        comp.ssrRender = ssrCompile(comp.template, instance)+      } -    const ssrRender = instance.ssrRender || comp.ssrRender-    if (ssrRender) {-      // optimized-      // resolve fallthrough attrs-      let attrs = instance.inheritAttrs !== false ? instance.attrs : undefined-      let hasCloned = false+      const ssrRender = instance.ssrRender || comp.ssrRender+      if (ssrRender) {+        // optimized+        // resolve fallthrough attrs+        let attrs = instance.inheritAttrs !== false ? instance.attrs : undefined+        let hasCloned = false -      let cur = instance-      while (true) {-        const scopeId = cur.vnode.scopeId-        if (scopeId) {-          if (!hasCloned) {-            attrs = { ...attrs }-            hasCloned = true+        let cur = instance+        while (true) {+          const scopeId = cur.vnode.scopeId+          if (scopeId) {+            if (!hasCloned) {+              attrs = { ...attrs }+              hasCloned = true+            }+            attrs![scopeId] = ''+          }+          const parent = cur.parent+          if (parent && parent.subTree && parent.subTree === cur.vnode) {+            // parent is a non-SSR compiled component and is rendering this+            // component as root. inherit its scopeId if present.+            cur = parent+          } else {+            break           }-          attrs![scopeId] = ''-        }-        const parent = cur.parent-        if (parent && parent.subTree && parent.subTree === cur.vnode) {-          // parent is a non-SSR compiled component and is rendering this-          // component as root. inherit its scopeId if present.-          cur = parent-        } else {-          break         }-      } -      if (slotScopeId) {-        if (!hasCloned) attrs = { ...attrs }-        const slotScopeIdList = slotScopeId.trim().split(' ')-        for (let i = 0; i < slotScopeIdList.length; i++) {-          attrs![slotScopeIdList[i]] = ''+        if (slotScopeId) {+          if (!hasCloned) attrs = { ...attrs }+          const slotScopeIdList = slotScopeId.trim().split(' ')+          for (let i = 0; i < slotScopeIdList.length; i++) {+            attrs![slotScopeIdList[i]] = ''+          }         }-      } -      // set current rendering instance for asset resolution-      const prev = setCurrentRenderingInstance(instance)-      try {-        ssrRender(-          instance.proxy,+        // set current rendering instance for asset resolution+        const prev = setCurrentRenderingInstance(instance)+        try {+          ssrRender(+            instance.proxy,+            push,+            instance,+            attrs,+            // compiler-optimized bindings+            instance.props,+            instance.setupState,+            instance.data,+            instance.ctx,+          )+        } finally {+          setCurrentRenderingInstance(prev)+        }+      } else if (instance.render && instance.render !== NOOP) {+        renderVNode(           push,+          (instance.subTree = renderComponentRoot(instance)),           instance,-          attrs,-          // compiler-optimized bindings-          instance.props,-          instance.setupState,-          instance.data,-          instance.ctx,+          slotScopeId,+        )+      } else {+        const componentName = comp.name || comp.__file || `<Anonymous>`+        warn(+          `Component ${componentName} is missing template or render function.`,         )-      } finally {-        setCurrentRenderingInstance(prev)+        push(`<!---->`)       }-    } else if (instance.render && instance.render !== NOOP) {-      renderVNode(-        push,-        (instance.subTree = renderComponentRoot(instance)),-        instance,-        slotScopeId,-      )-    } else {-      const componentName = comp.name || comp.__file || `<Anonymous>`-      warn(`Component ${componentName} is missing template or render function.`)-      push(`<!---->`)     }+  } catch (err) {+    // a render error may have left blocks open (e.g. a slot that threw inside+    // `renderSlot`). Discard them so they don't keep collecting vnodes created+    // by subsequent renders.+    resetBlockTracking()+    throw err+  } finally {+    if (__DEV__) popWarningContext()   }-  if (__DEV__) popWarningContext()   return getBuffer() }  
Merged fix · PR #15071+128 −24
packages/runtime-core/src/componentRenderContext.tsindex b1fc70c03..d10eba648 100644@@ -1,6 +1,6 @@ import type { ComponentInternalInstance } from './component' import { devtoolsComponentUpdated } from './devtools'-import { setBlockTracking } from './vnode'+import { blockStack, closeBlock, setBlockTracking } from './vnode'  /**  * mark the current rendering instance for asset resolution (e.g.@@ -89,10 +89,14 @@ export function withCtx(       setBlockTracking(-1)     }     const prevInstance = setCurrentRenderingInstance(ctx)+    const prevStackSize = blockStack.length     let res     try {       res = fn(...args)     } finally {+      // close blocks left dangling when the slot throws mid-block+      // inline blocks (for example `v-if`) have no helper to unwind themselves (#15070)+      for (let i = blockStack.length; i > prevStackSize; i--) closeBlock()       setCurrentRenderingInstance(prevInstance)       if (renderFnWithContext._d) {         setBlockTracking(1)packages/runtime-core/src/helpers/renderSlot.tsindex 2f1296bb1..8f65f8af4 100644@@ -9,6 +9,8 @@ import {   Fragment,   type VNode,   type VNodeArrayChildren,+  blockStack,+  closeBlock,   createBlock,   createVNode,   isVNode,@@ -71,32 +73,42 @@ export function renderSlot(   if (slot && (slot as ContextualRenderFn)._c) {     ;(slot as ContextualRenderFn)._d = false   }+  const prevStackSize = blockStack.length   openBlock()-  const validSlotContent = slot && ensureValidVNode(slot(props))-  const slotKey =-    props.key ||-    // slot content array of a dynamic conditional slot may have a branch-    // key attached in the `createSlots` helper, respect that-    (validSlotContent && (validSlotContent as any).key)-  const rendered = createBlock(-    Fragment,-    {-      key:-        (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) +-        // #7256 force differentiate fallback content from actual content-        (!validSlotContent && fallback ? '_fb' : ''),-    },-    validSlotContent || (fallback ? fallback() : []),-    validSlotContent && (slots as RawSlots)._ === SlotFlags.STABLE-      ? PatchFlags.STABLE_FRAGMENT-      : PatchFlags.BAIL,-  )+  let rendered: VNode+  try {+    const validSlotContent = slot && ensureValidVNode(slot(props))+    const slotKey =+      props.key ||+      // slot content array of a dynamic conditional slot may have a branch+      // key attached in the `createSlots` helper, respect that+      (validSlotContent && (validSlotContent as any).key)+    rendered = createBlock(+      Fragment,+      {+        key:+          (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) ++          // #7256 force differentiate fallback content from actual content+          (!validSlotContent && fallback ? '_fb' : ''),+      },+      validSlotContent || (fallback ? fallback() : []),+      validSlotContent && (slots as RawSlots)._ === SlotFlags.STABLE+        ? PatchFlags.STABLE_FRAGMENT+        : PatchFlags.BAIL,+    )+  } catch (err) {+    // close blocks left dangling when the slot throws mid-block+    // they would otherwise retain every vnode created afterwards (#15070)+    for (let i = blockStack.length; i > prevStackSize; i--) closeBlock()+    throw err+  } finally {+    if (slot && (slot as ContextualRenderFn)._c) {+      ;(slot as ContextualRenderFn)._d = true+    }+  }   if (!noSlotted && rendered.scopeId) {     rendered.slotScopeIds = [rendered.scopeId + '-s']   }-  if (slot && (slot as ContextualRenderFn)._c) {-    ;(slot as ContextualRenderFn)._d = true-  }   return rendered } packages/server-renderer/__tests__/ssrRender.spec.tsnew file mode 100644index 000000000..2d23452a3@@ -0,0 +1,84 @@+import { createSSRApp } from 'vue'+import { renderToString } from '../src/renderToString'++const gc = () =>+  new Promise<void>(resolve => {+    setTimeout(() => {+      global.gc!()+      resolve()+    })+  })++const Card = {+  props: { tag: { type: String, default: 'div' } },+  template: `<component :is="tag" class="card"><slot /></component>`,+}++const Page = {+  components: { Card },+  props: ['payload'],+  template: `<main><Card>{{ payload.title }}</Card></main>`,+}++describe.skipIf(!global.gc)('ssr: render error leak', () => {+  // #15070+  test('should GC apps created after a render error in a forwarded slot', async () => {+    const createApp = (payload: any) => createSSRApp(Page, { payload })++    expect(await renderToString(createApp({ title: 'ok' }))).toContain('ok')++    await expect(renderToString(createApp(null))).rejects.toThrow(+      `Cannot read properties of null`,+    )++    const weakRefs: { deref(): unknown | undefined }[] = []+    const renderOnce = async () => {+      const app = createApp({ title: 'ok' })+      // @ts-expect-error ES2021 API+      weakRefs.push(new WeakRef(app))+      expect(await renderToString(app)).toContain('ok')+    }+    for (let i = 0; i < 20; i++) {+      await renderOnce()+    }++    for (let i = 0; i < 5; i++) {+      await gc()+    }++    expect(weakRefs.filter(ref => ref.deref()).length).toBe(0)+  })++  test('should GC apps created after a render error in an inline block (`v-if`)', async () => {+    const PageIf = {+      props: ['payload'],+      template: `<component :is="'div'"><div v-if="payload.list">{{ payload.list.missing.x }}</div></component>`,+    }+    const createApp = (payload: any) => createSSRApp(PageIf, { payload })++    expect(+      await renderToString(createApp({ list: { missing: { x: 'ok' } } })),+    ).toContain('ok')++    await expect(renderToString(createApp({ list: {} }))).rejects.toThrow(+      `Cannot read properties of undefined`,+    )++    const weakRefs: { deref(): unknown | undefined }[] = []+    const renderOnce = async () => {+      const app = createApp({ list: { missing: { x: 'ok' } } })+      // @ts-expect-error ES2021 API+      weakRefs.push(new WeakRef(app))+      expect(await renderToString(app)).toContain('ok')+    }+    for (let i = 0; i < 20; i++) {+      await renderOnce()+    }++    for (let i = 0; i < 5; i++) {+      await gc()+    }++    expect(weakRefs.filter(ref => ref.deref()).length).toBe(0)+  })+})vitest.config.tsindex 2fbc92f92..8e1f5bec8 100644@@ -58,6 +58,7 @@ export default defineConfig({             '**/e2e/**',             '**/{vue,vue-compat,runtime-dom}/**',             'packages/server-renderer/__tests__/ssrWatch.spec.ts',+            'packages/server-renderer/__tests__/ssrRender.spec.ts',           ],         },       },@@ -66,7 +67,10 @@ export default defineConfig({         test: {           name: 'unit-gc',           pool: 'forks',-          include: ['packages/server-renderer/__tests__/ssrWatch.spec.ts'],+          include: [+            'packages/server-renderer/__tests__/ssrWatch.spec.ts',+            'packages/server-renderer/__tests__/ssrRender.spec.ts',+          ],           execArgv: ['--expose-gc'],         },       },