Skip to content

fix(build): resolve type errors and make OG image generation hermetic#76

Merged
AnnatarHe merged 1 commit into
masterfrom
claude/upbeat-noether-ett5yb
Jun 29, 2026
Merged

fix(build): resolve type errors and make OG image generation hermetic#76
AnnatarHe merged 1 commit into
masterfrom
claude/upbeat-noether-ett5yb

Conversation

@AnnatarHe

Copy link
Copy Markdown
Member

Summary

pnpm build (astro check && astro build) was failing. This PR fixes it so the build completes cleanly end-to-end.

There were two distinct failures:

1. astro check — 3 TypeScript errors in scripts/

The recently-added OpenAI tooling didn't type-check, which aborted the build before astro build even ran:

  • scripts/face.tscreateFile(filePath) had an implicit-any parameter that was also ignored (the body read a module-level path). Typed it string and used it.
  • scripts/generate-thumbnail.ts — the OpenAI input_image content item was missing the required detail field (ResponseInputImage requires it). Added detail: "auto".
  • scripts/generate-thumbnail.tsBuffer.from() was passed the nullable image result (ImageGenerationCall.result is string | null). Added a null guard before use.

2. astro build — OG image generation

src/components/OpenGraph/OG.tsx hardcoded a remote logo URL that Satori fetches and rasterizes at build time. This makes the build depend on external network availability. Switched to embedding the bundled local src/images/logo.png as a base64 data URI, mirroring the existing local font-loading pattern in createImage.ts. The build is now hermetic with no external dependency, and the OG layout/sizing is unchanged (logo is square 1800×1800).

Test plan

  • pnpm astro check0 errors (was 3).
  • pnpm build → completes successfully; all 71 /posts/*-og.png images generated with no remote fetch and no Satori "Image size cannot be determined" error. Exit code 0.

Out of scope (non-blocking, unchanged)

Pre-existing z is deprecated warnings in src/content.config.ts, a couple of unused-import hints, and the is:inline hint in index.astro — none of these fail the build.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AQkE4GN3oPKWA2YZcwD1hT


Generated by Claude Code

The production build (`astro check && astro build`) was failing for two reasons:

1. `astro check` reported 3 TypeScript errors in the `scripts/` tooling:
   - `face.ts`: untyped (implicit-any) `createFile` parameter that was also
     ignored — now typed `string` and actually used.
   - `generate-thumbnail.ts`: OpenAI `input_image` content was missing the
     required `detail` field — added `detail: "auto"`.
   - `generate-thumbnail.ts`: `Buffer.from()` received the nullable image
     result — added a null guard before use.

2. `astro build` failed during OG image generation because Satori fetched the
   logo from a remote CDN URL at build time. Switch to embedding the bundled
   local `src/images/logo.png` as a base64 data URI so the build is hermetic
   and has no external network dependency, mirroring the existing local font
   loading pattern.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AQkE4GN3oPKWA2YZcwD1hT
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@AnnatarHe AnnatarHe temporarily deployed to claude/upbeat-noether-ett5yb - asynctalk-website PR #76 June 29, 2026 02:27 — with Render Destroyed
@AnnatarHe AnnatarHe merged commit 2b2d736 into master Jun 29, 2026
1 check passed
@AnnatarHe AnnatarHe deleted the claude/upbeat-noether-ett5yb branch June 29, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants