From: Evan You Date: Wed, 28 Sep 2022 02:24:57 +0000 (+0800) Subject: fix(ssr): fix dynamic slot regression in ssr X-Git-Tag: v3.2.40~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8963c5508cde3a0c990b2748787ffb582b16f23f;p=thirdparty%2Fvuejs%2Fcore.git fix(ssr): fix dynamic slot regression in ssr fix #6651 --- diff --git a/packages/runtime-core/src/helpers/createSlots.ts b/packages/runtime-core/src/helpers/createSlots.ts index 89ea7ac77c..b44d1f1090 100644 --- a/packages/runtime-core/src/helpers/createSlots.ts +++ b/packages/runtime-core/src/helpers/createSlots.ts @@ -33,7 +33,8 @@ export function createSlots( const res = slot.fn(...args) // attach branch key so each conditional branch is considered a // different fragment - ;(res as any).key = slot.key + // #6651 res can be undefined in SSR in string push mode + if (res) (res as any).key = slot.key return res } : slot.fn