Skip to content

Conversation

@justblender
Copy link
Contributor

This PR introduces a new Vercel build adapter for @hono/vite-build.

The adapter compiles Hono apps to meet the Vercel Build Output API specifications with output files emitting in .vercel/output directory. It is designed for Vercel Serverless Functions and does not support Edge Runtime, which is being phased out in favor of Vercel's Fluid compute architecture.

The default export uses @hono/node-server/vercel adapter. Unfortunately, contrary to the official Vercel documentation, Node.js runtime still expects a node:http signature. Perhaps I'm mistaken or did something wrong, but none of the other variants (like using hono/vercel) produced a working function which wouldn't crash during runtime.

@changeset-bot
Copy link

changeset-bot bot commented Mar 23, 2025

🦋 Changeset detected

Latest commit: f66da1b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hono/vite-build Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@yusukebe
Copy link
Member

Hi @justblender

Thank you for the PR. I've left some comments. Please check them.

@justblender
Copy link
Contributor Author

@yusukebe regarding other comments, would you like to have a follow-up PR for these changes? I thought it would be fine to sneak in some minor type changes and JSDoc fixes along with this PR 🫠

@yusukebe
Copy link
Member

@justblender

Plus, please add proper tests to packages/build/test/adapter.test.ts.

@yusukebe
Copy link
Member

would you like to have a follow-up PR for these changes?

Yes. Please.

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

LGTM!

@yusukebe
Copy link
Member

Hi @justblender

Thank you for the PR and the quick fixes. Looks good. I'll merge this and release a new version. I appreciate your contribution!

@justblender
Copy link
Contributor Author

Hold on, got some changes in

@yusukebe yusukebe merged commit 314c66d into honojs:main Mar 24, 2025
2 checks passed
@yusukebe
Copy link
Member

@justblender

Oops. Please create another PR.

@kecoliva
Copy link

@yusukebe there seems to be an issue with this adapter, awaits c.req.json() freezes/hangs

@kecoliva
Copy link

@yusukebe there seems to be an issue with this adapter, awaits c.req.json() freezes/hangs

I ended up manually parsing the body from c.env.incoming

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.

3 participants