From aa8bf156b00e95f6ca2e78114171eaa42e04153d Mon Sep 17 00:00:00 2001 From: dswbx Date: Wed, 24 Sep 2025 09:53:28 +0200 Subject: [PATCH] fix: throw error if fetch called before build added a check in the fetch getter to prevent its usage before the application is built, ensuring proper usage and avoiding runtime issues. --- app/src/App.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/App.ts b/app/src/App.ts index 020cebb..0f535f8 100644 --- a/app/src/App.ts +++ b/app/src/App.ts @@ -244,6 +244,10 @@ export class App< } get fetch(): Hono["fetch"] { + if (!this.isBuilt()) { + throw new Error("App is not built yet, run build() first"); + } + return this.server.fetch as any; }