diff --git a/packages/astro/src/core/endpoint/index.ts b/packages/astro/src/core/endpoint/index.ts index 5822685cf987..9bbfbc4cd883 100644 --- a/packages/astro/src/core/endpoint/index.ts +++ b/packages/astro/src/core/endpoint/index.ts @@ -78,6 +78,7 @@ export function createAPIContext({ // We define a custom property, so we can check the value passed to locals Object.defineProperty(context, 'locals', { + enumerable: true, get() { return Reflect.get(request, clientLocalsSymbol); }, diff --git a/packages/astro/src/core/render/context.ts b/packages/astro/src/core/render/context.ts index eba81526e978..a43650a556cb 100644 --- a/packages/astro/src/core/render/context.ts +++ b/packages/astro/src/core/render/context.ts @@ -67,6 +67,7 @@ export async function createRenderContext( // We define a custom property, so we can check the value passed to locals Object.defineProperty(context, 'locals', { + enumerable: true, get() { return Reflect.get(request, clientLocalsSymbol); },