Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type system is not registered when use elysia type standalone #986

Open
motopods-lucas opened this issue Dec 31, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@motopods-lucas
Copy link

motopods-lucas commented Dec 31, 2024

What version of Elysia is running?

1.2.9

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

Just want to reuse elysia type system in other place such as read env or other settings.

import { TypeRegistry } from "@sinclair/typebox"
import "elysia/type-system"

console.log(TypeRegistry.Has("UnionEnum")) // output false

TypeRegistry in elysia is not the same instance as @sinclair/typebox.

What is the expected behavior?

TypeRegistry in "@sinclair/typebox" and "elysia" should share the state.
Maybe elysia shoud also export the Value, TypeRegistry FormatRegistry.

import { t } from "elysia"
t.Value.Prase(...)

So something like t.Value.Prase() will have the type and format which elysia registered .

What do you see instead?

No response

Additional information

No response

Have you try removing the node_modules and bun.lockb and try again yet?

No response

@motopods-lucas motopods-lucas added the bug Something isn't working label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant