Vercel Functions Now Support Bun.serve Entrypoints and Native WebSocket Handlers
Vercel has added support for using Bun.serve as a direct entrypoint in Vercel Functions, allowing developers to deploy native WebSockets and server.ts configurations without external frameworks.

Vercel has introduced native support for Bun.serve as an entrypoint for Vercel Functions utilizing the Bun runtime. This update enables developers to deploy server logic directly from a root-level server.ts file, maintaining consistency between local development and production environments without the need for additional web framework wrappers. With this integration, developers can map static, dynamic, and wildcard routes natively. The feature also enables native WebSocket support on Vercel Functions by allowing developers to initiate connection upgrades using the server.upgrade method directly within the fetch handler, resolving previous limitations on real-time event handling. Adopting this feature requires specifying bunVersion as 1.x or higher in the vercel.json configuration file and applying the Bun framework preset. When migrating existing functions, codebases must be adjusted to align routing structures and entrypoint filenames with the Bun.serve specifications.
Primary source
Open Vercel Changelog ↗This article summarizes the source. Check the original for full details and conditions.
Comparison
| Aspect | Before / Alternative | After / This |
|---|---|---|
| Entrypoint Configuration | Required framework adapters or wrapper configurations to route requests | Direct deployment of native server.ts using Bun.serve() |
| WebSocket Implementation | Restricted or required external workarounds to handle persistent connections | Native support via server.upgrade inside the fetch handler |
| Routing Management | Managed through framework-specific routing rules or Vercel JSON routing | Mapped natively via Bun's path and wildcard handling in server.ts |
Action Checklist
- Configure vercel.json to target bunVersion 1.x or higher Ensure your project configuration explicitly defines a compatible Bun runtime version.
- Set up a server.ts file at the root of your project Define the export default Bun.serve block including fetch and optional websocket handlers.
- Enable the Bun framework preset in your Vercel project settings This preset allows Vercel to automatically detect and build the Bun.serve entrypoint.