Skip to content

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

Open
@sunshinego12138

Description

@sunshinego12138

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions