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)