Closed bogeychan closed 1 month ago
1.0.22
WSL Ubuntu
// test.test.ts import { describe, it, expect } from "bun:test"; import { Elysia, type Context } from "elysia"; describe("AOT", () => { it("???", async () => { class Controller { static async handle(ctx: Context) { try { // @ts-ignore const { token } = ctx.body; return token; } catch { return "nope"; } } } const app = new Elysia({ aot: true }).post("/", Controller.handle); const response = await app.handle( new Request("http://localhost/", { method: "POST", body: JSON.stringify({ token: "yay" }), headers: { "Content-Type": "application/json" }, }) ); expect(await response.text()).toEqual("yay"); }); });
Pass all tests
Expected: "yay" Received: "nope"
workaround:
new Elysia({ aot: false })
reported on discord
Looks like its related to this: https://github.com/elysiajs/elysia/issues/656
What version of Elysia.JS is running?
1.0.22
What platform is your computer?
WSL Ubuntu
What steps can reproduce the bug?
What is the expected behavior?
Pass all tests
What do you see instead?
Additional information
workaround:
reported on discord