diff --git a/.changeset/old-mails-sneeze.md b/.changeset/old-mails-sneeze.md new file mode 100644 index 000000000000..adbaa29fff94 --- /dev/null +++ b/.changeset/old-mails-sneeze.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: ensure action function returns object diff --git a/packages/svelte/src/internal/client/render.js b/packages/svelte/src/internal/client/render.js index 30332096299f..93c823ce3364 100644 --- a/packages/svelte/src/internal/client/render.js +++ b/packages/svelte/src/internal/client/render.js @@ -2148,7 +2148,7 @@ export function action(dom, action, value_fn) { const value = value_fn(); untrack(() => { if (payload === undefined) { - payload = action(dom, value); + payload = action(dom, value) || {}; } else { const update = payload.update; if (typeof update === 'function') {