Skip to content

Commit 37cda75

Browse files
committed
check remixContext is promise or not
1 parent 150bfd1 commit 37cda75

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const handle = (userApp?: Hono, options?: Options) => {
2323
const args = createGetLoadContextArgs(c)
2424

2525
const remixContext = getLoadContext(args)
26-
return handler(c.req.raw, remixContext)
26+
return handler(c.req.raw, remixContext instanceof Promise ? await remixContext : remixContext)
2727
})
2828

2929
return app

src/remix.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type GetLoadContext = (args: {
1111
}) => AppLoadContext | Promise<AppLoadContext>
1212

1313
// eslint-disable-next-line @typescript-eslint/no-explicit-any
14-
export const defaultGetLoadContext = ({ context }: any) => {
14+
export const defaultGetLoadContext = ({ context }: any): AppLoadContext => {
1515
return {
1616
...context,
1717
}

0 commit comments

Comments
 (0)