diff --git a/.changeset/beige-kangaroos-appear.md b/.changeset/beige-kangaroos-appear.md new file mode 100644 index 000000000000..a17d19dc3a81 --- /dev/null +++ b/.changeset/beige-kangaroos-appear.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +[fix] adjust ActionData type diff --git a/packages/kit/src/core/sync/write_types/index.js b/packages/kit/src/core/sync/write_types/index.js index e6b13cd94c85..fac2e952b1d4 100644 --- a/packages/kit/src/core/sync/write_types/index.js +++ b/packages/kit/src/core/sync/write_types/index.js @@ -401,7 +401,7 @@ function process_node(node, outdir, is_page, proxies, all_pages_have_load = true ? `./proxy${replace_ext_with_js(basename)}` : path_to_original(outdir, node.server); - type = `Expand> | undefined`; + type = `Expand> | null`; } } exports.push(`export type ActionData = ${type};`); diff --git a/packages/kit/src/runtime/client/client.js b/packages/kit/src/runtime/client/client.js index 3957e2d57439..4d567052ea5e 100644 --- a/packages/kit/src/runtime/client/client.js +++ b/packages/kit/src/runtime/client/client.js @@ -497,7 +497,7 @@ export function create_client({ target, base }) { route, status, url: new URL(url), - form, + form: form ?? null, // The whole page store is updated, but this way the object reference stays the same data: data_changed ? data : page.data };