From 0c1baf9c72b44b27b56990becbb9b907f0ae0a93 Mon Sep 17 00:00:00 2001 From: Michael Seele Date: Thu, 18 Jan 2024 19:56:03 +0100 Subject: [PATCH] fix: prepare for astro 5.0 remove warning: [deprecated] The adapter @astro-aws/adapter is using a deprecated signature of the 'app.render()' method. From Astro 4.0, locals and routeData are provided as properties on an optional object to this method. Using the old signature will cause an error in Astro 5.0. See https://github.com/withastro/astro/pull/9199 for more information. --- packages/adapter/src/lambda/handlers/edge.ts | 2 +- packages/adapter/src/lambda/handlers/ssr.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/adapter/src/lambda/handlers/edge.ts b/packages/adapter/src/lambda/handlers/edge.ts index a1b6792..e1e8810 100644 --- a/packages/adapter/src/lambda/handlers/edge.ts +++ b/packages/adapter/src/lambda/handlers/edge.ts @@ -94,7 +94,7 @@ const createExports = ( return def } - const response = await app.render(request, routeData, args.locals) + const response = await app.render(request, { routeData, locals: args.locals }) const fnResponse = await createLambdaEdgeFunctionResponse( app, response, diff --git a/packages/adapter/src/lambda/handlers/ssr.ts b/packages/adapter/src/lambda/handlers/ssr.ts index 653346b..92f4f55 100644 --- a/packages/adapter/src/lambda/handlers/ssr.ts +++ b/packages/adapter/src/lambda/handlers/ssr.ts @@ -157,7 +157,7 @@ const createExports = ( } } - const response = await app.render(request, routeData, args.locals) + const response = await app.render(request, { routeData, locals: args.locals }) return createLambdaFunctionResponse( app,