diff --git a/src/dev.ts b/src/dev.ts index 45173b1..8323d73 100644 --- a/src/dev.ts +++ b/src/dev.ts @@ -23,7 +23,7 @@ export const handle = (userApp?: Hono, options?: Options) => { const args = createGetLoadContextArgs(c) const remixContext = getLoadContext(args) - return handler(c.req.raw, remixContext) + return handler(c.req.raw, remixContext instanceof Promise ? await remixContext : remixContext) }) return app diff --git a/src/remix.ts b/src/remix.ts index 22902a3..6d9ffb5 100644 --- a/src/remix.ts +++ b/src/remix.ts @@ -8,10 +8,10 @@ export type GetLoadContext = (args: { // eslint-disable-next-line @typescript-eslint/no-explicit-any cloudflare: any } -}) => AppLoadContext +}) => AppLoadContext | Promise // eslint-disable-next-line @typescript-eslint/no-explicit-any -export const defaultGetLoadContext = ({ context }: any) => { +export const defaultGetLoadContext = ({ context }: any): AppLoadContext => { return { ...context, }