Skip to main content

Overview

This guide helps you migrate your Hono applications between major versions. Follow the instructions for your specific version upgrade.

v4.3.11 to v4.4.0

deno.land/x to JSR

There is no breaking change, but we no longer publish the module from deno.land/x. If you want to use Hono on Deno, use JSR instead. Migration:
For more details, visit: https://hono.dev/getting-started/deno

v3.12.x to v4.0.0

There are several breaking changes in v4.0.0.

Removal of Deprecated Features

The following features have been removed:

AWS Lambda Adapter

Next.js Adapter

Context Methods

Hono Methods

HonoRequest Methods

serveStatic Requires manifest

For Cloudflare Workers, specify the manifest option:

Other Changes

  • JSX Renderer: docType option now defaults to true
  • JSX FC: Use PropsWithChildren instead of passing children to FC
  • Mime Types: Some mime types have been removed
  • Type Changes: Improved types for middleware chaining and validation

v2.7.8 to v3.0.0

c.req is now HonoRequest

c.req is now a HonoRequest object instead of Request. Access the raw Request via c.req.raw:

StaticRouter is Obsolete

The StaticRouter has been removed. Use the default router instead.

Validator Changes

The validator API has changed:

serveStatic from Adapters

serveStatic is now provided by adapters:

Service Worker Mode Deprecated

For Cloudflare Workers, use Module Worker mode instead:

Use type for Generics

Always use type instead of interface for generics:

v2.2.5 to v2.3.0

Auth Middleware Changes

If using Basic Auth or Bearer Auth in a handler, change:

v2.0.9 to v2.1.0

parseBody Changes

c.req.parseBody() now only parses FormData:

Generics Arguments Changed

The constructor now uses Variables and Bindings:

v1.6.4 to v2.0.0

Deno Middleware Import

Don’t import middleware from hono/mod.ts:
Cookie functions are now built-in:

Body Parse Middleware Removed

Use c.req.parseBody() instead:

GraphQL and Mustache Removed

GraphQL Server and Mustache middleware have been removed. Use third-party alternatives.

Best Practices

Always test your application thoroughly after upgrading to a new major version.
Check the official changelog for additional changes and improvements.
Update related packages like validators and middleware along with Hono.
If jumping multiple versions, upgrade one major version at a time.