From 90b7940669b8492f5b1f1f026a4f2a40e2b5c98f Mon Sep 17 00:00:00 2001 From: saltyaom Date: Sat, 13 Dec 2025 19:15:58 +0700 Subject: [PATCH] :wrench: fix: re-compile on promise module --- src/adapter/bun/index.ts | 2 ++ src/index.ts | 2 +- src/sucrose.ts | 4 ---- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/adapter/bun/index.ts b/src/adapter/bun/index.ts index 17642410..82e3e92d 100644 --- a/src/adapter/bun/index.ts +++ b/src/adapter/bun/index.ts @@ -393,6 +393,8 @@ export const BunAdapter: ElysiaAdapter = { // @ts-expect-error private app.promisedModules.then(async () => { + if (typeof app.config.aot) app.compile() + app.server?.reload({ ...serve, fetch: app.fetch, diff --git a/src/index.ts b/src/index.ts index 26b3b250..2acceb20 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8022,7 +8022,7 @@ export default class Elysia< : createDynamicHandler(this) Object.defineProperty(this, 'fetch', { - value: this.fetch, + value: this._handle, configurable: true, writable: true }) diff --git a/src/sucrose.ts b/src/sucrose.ts index 4fb5bc3c..1bc2d851 100644 --- a/src/sucrose.ts +++ b/src/sucrose.ts @@ -730,10 +730,6 @@ export const sucrose = ( ) code = code.slice(1, -1).trim() - console.log( - isContextPassToFunction(mainParameter, code, fnInference) - ) - if (!isContextPassToFunction(mainParameter, code, fnInference)) inferBodyReference(code, aliases, fnInference)