fix: serve og image, sitemap and icon as static assets - #12
Merged
Conversation
The og route rendered fine at build time but 404'd in production: takumi's native binary cannot run on Workers, and OpenNext does not ship a prerendered route-handler body as an asset. The card is now generated into public/ by a build script instead, and sitemap and icon moved to public/ for the same reason. Adds a guard so a missing pixel font fails the build rather than shipping a fallback face. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQy3ZJ5MyUxo4qjZwA93Na
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#11 shipped an OG card that rendered perfectly at build time and 404'd in production. Two causes:
@takumi-rs/image-response's Node build uses a native binary that cannot run on Cloudflare Workers, so the route could never execute there./sitemap.xmland/icon.svg404'd for the same class of reason (route-handler and app-convention outputs that never became assets).Fix
Everything is now a plain static asset, so nothing has to execute on the edge:
scripts/generate-og.tsxrenders the card in Node at build time and writespublic/og.png; wired intobuild,deploy, andpreviewso it can never drift from the designsitemap.xmlandicon.svgmoved topublic//og.png, plus an expliciticonsentrypublic/og.pngis gitignored since it is reproducible from the scriptVerified live on kyora.sh
//og.png/icon.svg/sitemap.xml/robots.txtog:imageandtwitter:imageboth resolve to the live PNG,twitter:cardissummary_large_image.🤖 Generated with Claude Code
https://claude.ai/code/session_01CQy3ZJ5MyUxo4qjZwA93Na