elysiajs / elysia

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

Invalid `onAfterHandle` typing #858

Open ghost opened 1 month ago

ghost commented 1 month ago

What version of Elysia is running?

1.1.17

What platform is your computer?

Darwin 24.0.0 arm64 arm

What steps can reproduce the bug?

import Elysia from 'elysia';

const app = new Elysia()
  .onAfterHandle(({ response }) => {
    if (response instanceof Response)
      return response

    return { res: response }
  })

What is the expected behavior?

response is typed correctly

What do you see instead?

its never

Additional information

related to #838 and #810

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

Yes