Open hagishi opened 8 months ago
When we use { as: 'global' }, it will work properly.
describe("eden test", () => {
it("derive local test", async () => {
const app = new Elysia()
.derive(() => ({ user: "name" }))
.get("/user", ({ user }) => user);
treaty(app).user.get(); // <- type error
});
it("derive global test", async () => {
const app = new Elysia()
.derive({ as: "global" }, () => ({ user: "name" }))
.get("/user", ({ user }) => user);
treaty(app).user.get(); // <- ok
});
});
Hi After testing various things with the RC version, it didn't work correctly. Below is the code I ran
capture
version elysia: 1.0.0-rc.15 @elysiajs/eden: 1.0.0-rc.4