Skip to content

Conversation

@iamStephenFang
Copy link
Contributor

Description

generateOgImageForSite() / generateOgImageForPost() return a Buffer, but in TypeScript’s type definitions, new Response() does not accept Node.js Buffer—it only accepts Web platform BodyInit types (such as Blob, ArrayBuffer, Uint8Array, etc.).

Astro uses Web API type definitions (dom lib) during build time, so Node.js Buffer types won’t match. Just simply convert the Buffer to a Uint8Array or ArrayBuffer to pass type checking.

Types of changes

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Documentation Update (if none of the other choices apply)
  • Others (any other types not listed above)

Checklist

  • I have read the Contributing Guide
  • I have added the necessary documentation (if appropriate)
  • Breaking Change (fix or feature that would cause existing functionality to not work as expected)

Further comments

Related Issue

It will fixed this issue

Closes: #560

alec-c4 added a commit to alec-c4/alec-c4.com that referenced this pull request Aug 12, 2025
satnaing
satnaing previously approved these changes Aug 21, 2025
Copy link
Owner

@satnaing satnaing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@satnaing
Copy link
Owner

BTW,
The CI flow failed.
Can you update the code formatting, please @iamStephenFang ?
pnpm format

@iamStephenFang
Copy link
Contributor Author

BTW, The CI flow failed. Can you update the code formatting, please @iamStephenFang ? pnpm format

Sure, I've pushed the new commit, sorry about code format issue

@satnaing satnaing merged commit aad5ac6 into satnaing:main Aug 21, 2025
1 check passed
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.

[BUG]: After building, the/og.png fetch failed

2 participants