-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
@elysiajs/jwt ^1.0.2 breaks type inference for handler functions #26
Comments
Up |
Any updates on this? Experiencing the same |
As a fix, I decided to convert the return value to an jwt({
name: "jwt",
secret: env.JWT_SECRET,
algorithms: ["HS256"],
ignoreExpiration: false,
audience: "https://api.domain.com",
issuer: "https://api.domain.com",
maxAge: "1d",
clockTolerance: 0,
}) as Elysia & { jwt: typeof jwt }; |
Thanks, that is a workable fix for now |
Updating to the latest version (1.1.0) fixed it for me |
Only works on 1.1.0, any bigger version
No BUN. |
adding @bun/types to dev dependency fixes things for me |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added
@elysiajs/jwt ^1.0.2
to my project and initialised it with the.use
hook. Everything seems to work fine however it breaks the type inference causing the handler method parameters to implicitly return a type of any.jwt
,query
,set
, andauth
now implicitly have the type of anyThe text was updated successfully, but these errors were encountered: