From c6d2581f78e72c7db2d1fcf089c57d4d377378d0 Mon Sep 17 00:00:00 2001 From: wadefletch Date: Mon, 9 Feb 2026 17:46:15 -0600 Subject: [PATCH 1/3] fix: move `hookable` to dependencies for correct type resolution `hookable` was listed as a devDependency, so consumers couldn't resolve the `HookableCore` type used in `NitroApp.hooks`, causing it to be typed as `any` in plugin definitions. Closes #3809 Co-authored-by: Cursor --- package.json | 2 +- pnpm-lock.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cb146f9fe9..458176f419 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "crossws": "^0.4.4", "db0": "^0.3.4", "h3": "^2.0.1-rc.14", + "hookable": "^6.0.1", "nf3": "^0.3.10", "ofetch": "^2.0.0-alpha.3", "ohash": "^2.0.11", @@ -127,7 +128,6 @@ "get-port-please": "^3.2.0", "giget": "^3.1.2", "gzip-size": "^7.0.0", - "hookable": "^6.0.1", "httpxy": "^0.1.7", "klona": "^2.0.6", "knitwork": "^1.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 243e2f4837..bfd79600a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,6 +27,9 @@ importers: h3: specifier: ^2.0.1-rc.14 version: 2.0.1-rc.14(crossws@0.4.4(srvx@0.11.2)) + hookable: + specifier: ^6.0.1 + version: 6.0.1 jiti: specifier: ^2.6.1 version: 2.6.1 @@ -193,9 +196,6 @@ importers: gzip-size: specifier: ^7.0.0 version: 7.0.0 - hookable: - specifier: ^6.0.1 - version: 6.0.1 httpxy: specifier: ^0.1.7 version: 0.1.7 From 9e40bc695e6bec64b69f7e1b27b22ab1f0a5681b Mon Sep 17 00:00:00 2001 From: wadefletch Date: Mon, 9 Feb 2026 18:39:16 -0600 Subject: [PATCH 2/3] docs(plugins): fix response hook signature and add close hook The `response` hook signature was documented as `(event, { body })` but the actual type is `(res: Response, event: HTTPEvent)`. Also adds the `close` hook which was shown in examples but missing from the available hooks list. Co-authored-by: Cursor --- docs/1.docs/50.plugins.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/1.docs/50.plugins.md b/docs/1.docs/50.plugins.md index 5b568167e4..4ae6c79cd4 100644 --- a/docs/1.docs/50.plugins.md +++ b/docs/1.docs/50.plugins.md @@ -54,9 +54,10 @@ export default definePlugin((nitro) => { ### Available hooks +- `"close", () => {}` - `"request", (event) => {}` - `"error", (error, { event? }) => {}` -- `"response", (event, { body }) => {}` +- `"response", (res, event) => {}` ## Examples From c11d2a03217a0290f4903b797739da2837ffaa65 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 10 Feb 2026 12:56:12 +0100 Subject: [PATCH 3/3] update build config --- build.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/build.config.ts b/build.config.ts index fa4a5e3cc7..993eddc1ac 100644 --- a/build.config.ts +++ b/build.config.ts @@ -15,7 +15,6 @@ const tracePkgs = [ "defu", // used by open-api runtime "destr", // used by node-server and deno-server "get-port-please", // used by dev server - "hookable", // used by app.ts "rendu", // used by HTML renderer template "scule", // used by runtime config "source-map", // used by dev error runtime