Skip to content

Commit c6ebcc6

Browse files
committed
chore: fix internal type issue
1 parent 97ff9d5 commit c6ebcc6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/runtime/internal/app.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
fetchNodeRequestHandler,
2323
callNodeRequestHandler,
2424
type AbstractRequest,
25+
type NodeRequestHandler,
2526
} from "node-mock-http";
2627
import { cachedEventHandler } from "./cache";
2728
import { useRuntimeConfig } from "./config";
@@ -132,15 +133,18 @@ function createNitroApp(): NitroApp {
132133
});
133134

134135
// Create local fetch caller
135-
const nodeHandler = toNodeListener(h3App);
136+
const nodeHandler = toNodeListener(h3App); // TODO: Update h3 v1 types
136137
const localCall = (aRequest: AbstractRequest) =>
137-
callNodeRequestHandler(nodeHandler, aRequest);
138+
callNodeRequestHandler(
139+
nodeHandler as unknown as NodeRequestHandler,
140+
aRequest
141+
);
138142
const localFetch: typeof fetch = (input, init) => {
139143
if (!input.toString().startsWith("/")) {
140144
return globalThis.fetch(input, init);
141145
}
142146
return fetchNodeRequestHandler(
143-
nodeHandler,
147+
nodeHandler as unknown as NodeRequestHandler,
144148
input as string /* TODO */,
145149
init
146150
).then((response) => normalizeFetchResponse(response));

0 commit comments

Comments
 (0)