Nitro · h3

NITRO0027Import 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.

Why it happens

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.

Fix

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"

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm vite-doctor . --framework nitro --rules nitro/h3/prefer-nitro-h3
Copyright © 2026