fix: resolve image demo /api/image 500 on Vercel#253
Merged
ctate merged 1 commit intovercel-labs:mainfrom Apr 7, 2026
Merged
Conversation
Add outputFileTracingIncludes so the Geist font TTF is bundled at the symlink path the code reads from. In a pnpm monorepo the file was only traced at the .pnpm store path, which Vercel does not map back to the node_modules/geist/ symlink.
Contributor
|
@vzt7 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
|
@vzt7 Thanks for the contribution and the thorough root cause analysis! |
Ari4ka
approved these changes
Apr 7, 2026
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.
Summary
The
/api/imageendpoint returns 500 onimage-demo.json-render.dev.Root cause
The image API uses Satori + resvg to render JSON specs into PNG. Satori requires font data passed as an
ArrayBuffer, which the route loads viafs.readFilefrom:In a pnpm monorepo,
node_modules/geistis a symlink pointing to the real location insidenode_modules/.pnpm/geist@.../. Next.js file tracing (nft) traces the real path in the.pnpmstore, but when Vercel assembles the serverless function it copies only the real file — the symlink atnode_modules/geist/...does not exist in the function filesystem. SoreadFilethrowsENOENTand the unhandled error surfaces as a 500.Fix
Added
outputFileTracingIncludesinnext.config.tsto explicitly include the font file at the symlink path, ensuring it is present where the code expects it.Test plan
next start—/api/imagereturns 200 with valid PNG