]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(ssr): fix dynamic slot regression in ssr
authorEvan You <yyx990803@gmail.com>
Wed, 28 Sep 2022 02:24:57 +0000 (10:24 +0800)
committerEvan You <yyx990803@gmail.com>
Wed, 28 Sep 2022 02:25:01 +0000 (10:25 +0800)
fix #6651

packages/runtime-core/src/helpers/createSlots.ts

index 89ea7ac77c825ac73529a8017833d0a38f02b238..b44d1f1090ba5daab34730bf2e59f890bdb30d2e 100644 (file)
@@ -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