Nitro · NITRO0027

Import H3 through nitro/h3 in Nitro 3 server code

Flags value imports and re-exports from h3 in Nitro 3 server code, in packages that declare nitro as a runtime dependency, and in the server runtime of Nuxt 5 module packages.
NITRO0027vite-doctor/nitroh3warnSuggestion

Run this rule

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

Why it matters

Nitro 3 imports every H3 utility from nitro/h3, which re-exports the h3 Nitro runs. In a Nuxt 5 app, server code from a package that imports values from h3 makes Nuxt treat it as Nitro v2 code, apply its Nitro v2 compatibility layer to the whole app, and warn NUXT_B9003. In app server code, a bare h3 import resolves the h3 the app installs, which matches Nitro's only while the two ranges stay in step.

Import H3 values from "nitro/h3". Type-only imports from "h3" can stay.

Example

Import H3 through Nitro

Before

import { HTTPError, defineHandler } from "h3"

After

import { HTTPError, defineHandler } from "nitro/h3"
Copyright © 2026