diff --git a/packages/kit/src/runtime/server/endpoint.js b/packages/kit/src/runtime/server/endpoint.js index ab6cbfc027e6..338791b4d0b1 100644 --- a/packages/kit/src/runtime/server/endpoint.js +++ b/packages/kit/src/runtime/server/endpoint.js @@ -29,7 +29,9 @@ export async function render_endpoint(event, route) { return method_not_allowed(mod, method); } - const response = await handler(event); + const response = await handler( + /** @type {import('types').RequestEvent>} */ (event) + ); if (!(response instanceof Response)) { return new Response( diff --git a/packages/kit/src/runtime/server/page/render.js b/packages/kit/src/runtime/server/page/render.js index 835b0b7b0986..31d9f494a8dd 100644 --- a/packages/kit/src/runtime/server/page/render.js +++ b/packages/kit/src/runtime/server/page/render.js @@ -86,7 +86,7 @@ export async function render_response({ /** @type {import('types').Page} */ page: { error, - params: event.params, + params: /** @type {Record} */ (event.params), routeId: event.routeId, status, url: state.prerendering ? new PrerenderingURL(event.url) : event.url, diff --git a/packages/kit/src/runtime/server/page/types.d.ts b/packages/kit/src/runtime/server/page/types.d.ts index 556496ee3486..c3230ddf995a 100644 --- a/packages/kit/src/runtime/server/page/types.d.ts +++ b/packages/kit/src/runtime/server/page/types.d.ts @@ -1,4 +1,4 @@ -import { JSONValue, ResponseHeaders, SSRNode, CspDirectives } from 'types'; +import { ResponseHeaders, SSRNode, CspDirectives } from 'types'; import { HttpError } from '../../../index/private'; export interface Fetched { @@ -21,7 +21,7 @@ export interface FetchState { export type Loaded = { node: SSRNode; data: Record | null; - server_data: JSONValue; + server_data: any; }; type CspMode = 'hash' | 'nonce' | 'auto';