diff --git a/packages/nuxi/package.json b/packages/nuxi/package.json index f6ce3d9b13..dd55b48414 100644 --- a/packages/nuxi/package.json +++ b/packages/nuxi/package.json @@ -35,6 +35,7 @@ "execa": "^6.1.0", "flat": "^5.0.2", "giget": "^0.1.7", + "h3": "^0.7.21", "jiti": "^1.16.0", "listhen": "^0.3.4", "mlly": "^0.5.16", diff --git a/packages/nuxi/src/commands/analyze.ts b/packages/nuxi/src/commands/analyze.ts index a0e5c330c5..6dab922740 100644 --- a/packages/nuxi/src/commands/analyze.ts +++ b/packages/nuxi/src/commands/analyze.ts @@ -1,6 +1,6 @@ import { promises as fsp } from 'node:fs' import { join, resolve } from 'pathe' -import { createApp, lazyHandle } from 'h3' +import { createApp, defineLazyHandler } from 'h3' import { listen } from 'listhen' import { writeTypes } from '../utils/prepare' import { loadKit } from '../utils/kit' @@ -37,7 +37,7 @@ export default defineNuxtCommand({ const app = createApp() - const serveFile = (filePath: string) => lazyHandle(async () => { + const serveFile = (filePath: string) => defineLazyHandler(async () => { const contents = await fsp.readFile(filePath, 'utf-8') return (_req, res) => { res.end(contents) } }) diff --git a/yarn.lock b/yarn.lock index 037e846838..4a48d8aa64 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10470,6 +10470,7 @@ __metadata: flat: ^5.0.2 fsevents: ~2.3.2 giget: ^0.1.7 + h3: ^0.7.21 jiti: ^1.16.0 listhen: ^0.3.4 mlly: ^0.5.16