elysiajs / elysia

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

Cannot return error on resolve when set ElysiaConfig aot to false #888

Closed thanatpp closed 1 week ago

thanatpp commented 1 month ago

What version of Elysia is running?

"elysia": "1.1.22"

What platform is your computer?

Darwin 24.0.0 arm64 arm

What steps can reproduce the bug?

import Elysia, { error } from "elysia";

const app = new Elysia({ aot: false })
  .resolve(() => {
    return error(401);
  })
  .get("/hello", () => "Hello")
  .listen(3000);

What is the expected behavior?

When we call endpoint /hello should be response an error status code 401.

What do you see instead?

No response

Additional information

No response

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

yes