Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sveltejs/kit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @sveltejs/kit@2.20.6
Choose a base ref
...
head repository: sveltejs/kit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @sveltejs/kit@2.20.7
Choose a head ref
  • 2 commits
  • 6 files changed
  • 3 contributors

Commits on Apr 14, 2025

  1. fix: regression when serializing server data (#13709)

    * fix: regression when serializing server data
    
    * fix
    
    ---------
    
    Co-authored-by: Rich Harris <rich.harris@vercel.com>
    Conduitry and Rich-Harris authored Apr 14, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fa00cc3 View commit details
  2. Version Packages (#13710)

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Apr 14, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1c6c7c9 View commit details
6 changes: 6 additions & 0 deletions packages/kit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sveltejs/kit

## 2.20.7
### Patch Changes


- fix: regression when serializing server data ([#13709](https://github.com/sveltejs/kit/pull/13709))

## 2.20.6
### Patch Changes

2 changes: 1 addition & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sveltejs/kit",
"version": "2.20.6",
"version": "2.20.7",
"description": "SvelteKit is the fastest way to build Svelte apps",
"keywords": [
"framework",
4 changes: 3 additions & 1 deletion packages/kit/src/runtime/server/data/index.js
Original file line number Diff line number Diff line change
@@ -253,7 +253,7 @@ export function get_data_json(event, options, nodes) {
return JSON.stringify(node);
}

return `{"type":"data","data":${devalue.stringify(node.data, reducers)},${JSON.stringify(
return `{"type":"data","data":${devalue.stringify(node.data, reducers)},"uses":${JSON.stringify(
serialize_uses(node)
)}${node.slash ? `,"slash":${JSON.stringify(node.slash)}` : ''}}`;
});
@@ -263,6 +263,8 @@ export function get_data_json(event, options, nodes) {
chunks: count > 0 ? iterator : null
};
} catch (e) {
// @ts-expect-error
e.path = 'data' + e.path;
throw new Error(clarify_devalue_error(event, /** @type {any} */ (e)));
}
}
2 changes: 2 additions & 0 deletions packages/kit/src/runtime/server/page/render.js
Original file line number Diff line number Diff line change
@@ -658,6 +658,8 @@ function get_data(event, options, nodes, csp, global) {
chunks: count > 0 ? iterator : null
};
} catch (e) {
// @ts-expect-error
e.path = e.path.slice(1);
throw new Error(clarify_devalue_error(event, /** @type {any} */ (e)));
}
}
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/server/utils.js
Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ export function redirect_response(status, location) {
*/
export function clarify_devalue_error(event, error) {
if (error.path) {
return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error.message} (data${error.path})`;
return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error.message} (${error.path})`;
}

if (error.path === '') {
2 changes: 1 addition & 1 deletion packages/kit/src/version.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// generated during release, do not modify

/** @type {string} */
export const VERSION = '2.20.6';
export const VERSION = '2.20.7';