Closed thennothinghappened closed 1 year ago
I've just tested this in Elysia's examples for better feedback, got this log output:
3537 | if (typeof Bun === 'undefined')
3538 | throw new Error(
3539 | '.listen() is designed to run on Bun only. If you are running Elysia in other environment please use a dedicated plugin or export the handler via Elysia.fetch'
3540 | )
3541 |
3542 | this.server = Bun?.serve(serve)
^
TypeError: Expected fetch() to be a function
code: "ERR_INVALID_ARG_TYPE"
at /Users/orca/Documents/GitHub/elysia/src/index.ts:3542:16
at /Users/orca/Documents/GitHub/elysia/example/http.ts:118:2
3537 | if (typeof Bun === 'undefined')
3538 | throw new Error(
3539 | '.listen() is designed to run on Bun only. If you are running Elysia in other environment please use a dedicated plugin or export the handler via Elysia.fetch'
3540 | )
3541 |
3542 | this.server = Bun?.serve(serve)
^
TypeError: Expected fetch() to be a function
code: "ERR_INVALID_ARG_TYPE"
at /Users/orca/Documents/GitHub/elysia/src/index.ts:3542:16
at /Users/orca/Documents/GitHub/elysia/example/http.ts:118:2
Should've looked around just a little more before posting :)
Found oven-sh/bun/issues/4555, this isn't an issue with Elysia.
Hello! I'm trying out Elysia and trying to get TLS working. I haven't seen this mentioned anywhere, aside from one mention on Bun's own
Bun.serve
. I noticed thatlisten({})
can take atls
prop as well, so put in as so:This is the only file of the project right now. Running without
tls
specified works fine, but with it prints a huge mess of minified code followed by:I'm assuming Elysia itself uses
Bun.serve
as a base? With that, as a test I tried specifying afetch(req, server)
to see what'd happen, and the same error still prints, so must be something internal.Apologies if this is already known or not within the scope of the project, its been difficult to find much information anything TLS related, and this project doesn't seem to mention it anywhere, which makes it unusable in my use case