From 95c83615aa1a92f6f7b617af4dfbe15cce962e59 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 3 Jul 2024 14:44:19 -0400 Subject: [PATCH] fix: make props optional during SSR --- .changeset/itchy-pianos-marry.md | 5 +++++ packages/svelte/src/internal/server/index.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/itchy-pianos-marry.md diff --git a/.changeset/itchy-pianos-marry.md b/.changeset/itchy-pianos-marry.md new file mode 100644 index 0000000000..24e7045035 --- /dev/null +++ b/.changeset/itchy-pianos-marry.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: make props optional during SSR diff --git a/packages/svelte/src/internal/server/index.js b/packages/svelte/src/internal/server/index.js index 101bdfb90f..97ddc6c3aa 100644 --- a/packages/svelte/src/internal/server/index.js +++ b/packages/svelte/src/internal/server/index.js @@ -113,7 +113,7 @@ export function render(component, options = {}) { } // @ts-expect-error - component(payload, options.props, {}, {}); + component(payload, options.props ?? {}, {}, {}); if (options.context) { pop();