From e5c9fadd1ddce105551f240ecce4b8adabaad35f Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Sat, 9 May 2026 18:11:42 +0200 Subject: [PATCH] fix(speak): explicit imports for voice-quota helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nitro auto-import doesn't reliably pick up named exports from db/voiceQuota.ts at runtime — speak endpoint threw 500 with "ReferenceError: getRemainingVoiceQuota is not defined". Explicit imports for getRemainingVoiceQuota, consumeVoiceQuota, estimateAudioSeconds + getPlanLimits. Co-Authored-By: Claude Opus 4.7 (1M context) --- backend/server/api/coach/speak.post.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/server/api/coach/speak.post.ts b/backend/server/api/coach/speak.post.ts index 680c173..238337f 100644 --- a/backend/server/api/coach/speak.post.ts +++ b/backend/server/api/coach/speak.post.ts @@ -1,5 +1,11 @@ import type { H3Event } from "h3"; import type { VoiceConfig } from "../../utils/plan-features"; +import { getPlanLimits } from "../../utils/plan-features"; +import { + getRemainingVoiceQuota, + consumeVoiceQuota, + estimateAudioSeconds, +} from "../../db/voiceQuota"; /** * POST /api/coach/speak