Skip to content

When the aot setting is set to false, using guard to apply after response to multiple routes does not take effect #1609

@zhuyankun

Description

@zhuyankun

What version of Elysia is running?

1.4.18

What platform is your computer?

MacOS

What environment are you using

bun 1.3.4

Are you using dynamic mode?

yes

What steps can reproduce the bug?

import { Elysia } from "elysia"

new Elysia({ aot: false })
.guard(
{
afterResponse: () => {
console.log("afterResponse")
},
},
(app) => app.get("/test", () => "afterResponse")
)
.get("/", () => "hi")
.listen(3000)

What is the expected behavior?

Console output: afterResponse

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?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreviewWaiting for issue reporter approval

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions