Open winston0410 opened 1 week ago
hi @winston0410 Try using Deno.serve.
Hi @winston0410
As @EdamAme-x said, please use Deno.serve()
instead of export default app
:
Deno.serve(app.fetch)
The starter template and the website was using export default app
, but as you faced it, it might be better to use Deno.serve()
. So, I've updated the docs:
https://github.com/honojs/website/pull/420
Thanks.
What version of Hono are you using?
4.4.8
What runtime/platform is your app running on?
Deno
What steps can reproduce the bug?
What is the expected behavior?
Running without error
What do you see instead?
TypeError: Cannot destructure property 'remoteAddr' of 'c.env' as it is undefined. at getConnInfo (https://jsr.io/@hono/hono/4.4.8/src/adapter/deno/conninfo.ts:9:11) at dispatch (https://jsr.io/@hono/hono/4.4.8/src/compose.ts:74:23) at https://jsr.io/@hono/hono/4.4.8/src/compose.ts:40:12 at https://jsr.io/@hono/hono/4.4.8/src/hono-base.ts:443:31 at Hono.dispatch (https://jsr.io/@hono/hono/4.4.8/src/hono-base.ts:454:6) at Hono.fetch (https://jsr.io/@hono/hono/4.4.8/src/hono-base.ts:473:17) at handler (ext:deno_http/00_serve.ts:557:26) at ext:deno_http/00_serve.ts:332:24 at ext:deno_http/00_serve.ts:503:29
Additional information
No response