-
-
Couldn't load subscription status.
- Fork 370
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What version of Elysia is running?
1.3.21
What platform is your computer?
Darwin 24.6.0 arm64 arm
What environment are you using
Bun v1.2.21
Are you using dynamic mode?
No
What steps can reproduce the bug?
When using t.MaybeEmpty, the top-level type is inferred as unknown. The issue doesn't seem to happen with t.Nullable etc. But it's also reproducible when doing an union with undefined or void, e.g. t.Union([t.Undefined(), ...])
What is the expected behavior?
Expected type of query to be { name: string } | undefined
What do you see instead?
Type of query is unknown
Additional information
This code can reproduce the issue
import { expectTypeOf } from "bun:test";
import { Elysia, t } from "elysia";
const app = new Elysia().get("/", () => "Hello Elysia", {
query: t.MaybeEmpty(t.Object({ name: t.String() }))
});
expectTypeOf(app["~Routes"].get.query).not.toEqualTypeOf<unknown>();Have you try removing the node_modules and bun.lockb and try again yet?
Yes
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working