Nitro · NITRO0017

Replace H3 v2 useBase

H3 v2 renamed useBase() to withBase().
NITRO0017vite-doctor/nitromigrationwarnSuggestion

Run this rule

pnpm vite-doctor . --framework nitro --rules nitro/h3/prefer-with-base

Why it matters

H3 v2 documents withBase() as the handler wrapper for mounting an application under a path prefix, while useBase() remains a legacy alias.

Import withBase and replace useBase(base, handler) with withBase(base, handler).

Example

Use the H3 v2 path-prefix wrapper

Before

const handler = useBase("/api", app.handler)

After

const handler = withBase("/api", app.handler)
Copyright © 2026