Skip to content

Commit

Permalink
Fix astro build error
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Dec 8, 2023
1 parent ae9810e commit 8cc8b9d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-icons-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystatic/astro': patch
---

Fix build error
12 changes: 9 additions & 3 deletions packages/astro/src/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 8cc8b9d

Please sign in to comment.