Open dodas opened 6 months ago
What runtime are you using ?
@Inplex-sys I am compiling with pkg
, meaning it's Node (v18.12.1) and using @whatwg-node/server as the Request/Response API compatibility layer.
Everything works fine when not compiling to binary.
Seems like bun also supports compiling to binary, I imagine a similar issue would occur there.
What version of Elysia.JS is running?
0.8.17
What platform is your computer?
Darwin 23.1.0 arm64 arm
What steps can reproduce the bug?
When compiling an application to binary code using
pkg
, stringifying functions will result in a string[native code]
. This breaks elysia's attempts to optimize the code by analyzing the stringified function and results inquery
orheaders
being undefined, unless explicit type schema is specified for them. Could we skip these optimizations when dealing with compiled code?What is the expected behavior?
Elysia works with comiled code, even if with slightly worse performance.
What do you see instead?
query
andheaders
is undefined unless I explicitly specify their type schema.