From 8e29f428d7b06625ba9d58e6bda1f0a2e2929ded Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 7 May 2026 22:29:24 +0200 Subject: [PATCH] fix(documents): merge +page.server data into +page.ts return (#385) SvelteKit's PageData type generation only picks up +page.ts return values when both files exist, so the runtime-merged server data was invisible to TypeScript and svelte-check flagged every q/from/to/etc access in +page.svelte. Spreading data into the +page.ts return restores the merge at the type level. No runtime behaviour change. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/routes/documents/+page.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/routes/documents/+page.ts b/frontend/src/routes/documents/+page.ts index de74bdce..0127696a 100644 --- a/frontend/src/routes/documents/+page.ts +++ b/frontend/src/routes/documents/+page.ts @@ -2,8 +2,9 @@ import { browser } from '$app/environment'; import { fetchDensity } from '$lib/document/timeline'; import type { PageLoad } from './$types'; -export const load: PageLoad = async ({ url, fetch }) => { +export const load: PageLoad = async ({ url, fetch, data }) => { const view = url.searchParams.get('view'); const isDesktop = browser && window.matchMedia('(min-width: 640px)').matches; - return await fetchDensity(fetch, view, isDesktop); + const density = await fetchDensity(fetch, view, isDesktop); + return { ...data, ...density }; };