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

The third parameter of the request method does not have a type prompt #995

Open
sunshinego12138 opened this issue Jan 5, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@sunshinego12138
Copy link

What version of Elysia is running?

latest / 1.2.10

What platform is your computer?

Darwin 23.5.0 arm64 arm

What steps can reproduce the bug?

bun add elysia@lastest
import Elysia, { t } from 'elysia'

new Elysia()
	.get('/', ({ query: { id } }) => typeof id, {
		query: t.Object({
			id: t.Number()
    }),
	})
	.listen(3000)

What is the expected behavior?

Hope to obtain the correct type prompt

What do you see instead?

When the mouse is placed on query: {id}, there is no prompt for number, but for id: string | undefined

And when the corresponding type prompt cannot be obtained in the third parameter of the get method

Additional information

I tried using it in version 1.1.20 and was able to get the correct type prompt. However, this is only the last version I used and not the last one that can get the correct prompt

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

yes

@sunshinego12138 sunshinego12138 added the bug Something isn't working label Jan 5, 2025
@sunshinego12138
Copy link
Author

After testing, this issue will occur after version 1.1.27, while in previous versions it was possible to correctly obtain type prompts

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