You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use executionCtx.waitUntil on CloudFlare Workers, but ignore and just await when running on Bun (since waitUntil is unsupported by Bun.serve)
Thank you for creating the issue. It's not a bug, but we may have to consider whether it should throw the error or not. As you said, it's convenient that it returns undefined.
It may not be the best solution, but you can use getRuntimeKey() to detect the runtime and make it do the c.executionCxt only in the workerd case.
What version of Hono are you using?
4.3.3
What runtime/platform is your app running on?
Bun
What steps can reproduce the bug?
I want to use executionCtx.waitUntil on CloudFlare Workers, but ignore and just await when running on Bun (since waitUntil is unsupported by Bun.serve)
However this crashes at the "if (c.executionCtx)" guard because executionCtx is a getter function that throws when it's not available.
Shouldn't this return undefined or null instead of throwing to allow for the use case above?
What is the expected behavior?
Do not throw.
What do you see instead?
error: This context has no ExecutionContext
as per
hono/src/context.ts
Line 183 in aebaa28
Additional information
No response
The text was updated successfully, but these errors were encountered: