From 8cc8b9da7601b1adc75cf6077c3598a233bb0a8a Mon Sep 17 00:00:00 2001 From: Emma Hamilton Date: Fri, 8 Dec 2023 14:56:46 +1000 Subject: [PATCH] Fix astro build error --- .changeset/violet-icons-hug.md | 5 +++++ packages/astro/src/api.tsx | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changeset/violet-icons-hug.md diff --git a/.changeset/violet-icons-hug.md b/.changeset/violet-icons-hug.md new file mode 100644 index 000000000..49c074812 --- /dev/null +++ b/.changeset/violet-icons-hug.md @@ -0,0 +1,5 @@ +--- +'@keystatic/astro': patch +--- + +Fix build error diff --git a/packages/astro/src/api.tsx b/packages/astro/src/api.tsx index 6d95895a5..38e36820e 100644 --- a/packages/astro/src/api.tsx +++ b/packages/astro/src/api.tsx @@ -11,13 +11,19 @@ export function makeHandler(_config: APIRouteConfig) { ..._config, clientId: _config.clientId ?? - tryOrUndefined(() => import.meta.env.KEYSTATIC_GITHUB_CLIENT_ID), + tryOrUndefined(() => { + return import.meta.env.KEYSTATIC_GITHUB_CLIENT_ID; + }), clientSecret: _config.clientSecret ?? - tryOrUndefined(() => import.meta.env.KEYSTATIC_GITHUB_CLIENT_SECRET), + tryOrUndefined(() => { + return import.meta.env.KEYSTATIC_GITHUB_CLIENT_SECRET; + }), secret: _config.secret ?? - tryOrUndefined(() => import.meta.env.KEYSTATIC_SECRET), + tryOrUndefined(() => { + return import.meta.env.KEYSTATIC_SECRET; + }), }, { slugEnvName: 'PUBLIC_KEYSTATIC_GITHUB_APP_SLUG',