elysiajs / elysia

Ergonomic Framework for Humans
https://elysiajs.com
MIT License
9.23k stars 198 forks source link

`app.onStart()` types and documentation does not match and does not work #621

Open touhidurrr opened 3 months ago

touhidurrr commented 3 months ago

What version of Elysia.JS is running?

1.0.13

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

When I hover over app.onStart(), I see: image However, copy pasting the code gives you: image As you can see from this image, even when I copy paste the documented code, I do not get the types.

What is the expected behavior?

Types should be available.

What do you see instead?

Types cannot be found.

Additional information

Also, string formatting is not done properly in example. The example has:

new Elysia()
  .onStart(({ url, port }) => {
    console.log('Running at ${url}:${port}');
  })

However, it should be:

new Elysia()
  .onStart(({ url, port }) => {
    console.log(`Running at ${url}:${port}`);
  })
touhidurrr commented 3 months ago

Also, after running the code: image