From 1de1eb8a29a845779203de3a9dfb8071c7a31cb9 Mon Sep 17 00:00:00 2001 From: Prospector <6166773+Prospector@users.noreply.github.com> Date: Thu, 8 Jan 2026 15:19:37 -0800 Subject: [PATCH] Use node env vars to fix dev env --- apps/frontend/src/composables/fetch.js | 9 +-------- apps/frontend/src/helpers/api.ts | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/apps/frontend/src/composables/fetch.js b/apps/frontend/src/composables/fetch.js index 80d619cd6d..3796e4a1b2 100644 --- a/apps/frontend/src/composables/fetch.js +++ b/apps/frontend/src/composables/fetch.js @@ -6,14 +6,7 @@ async function getRateLimitKey(config) { if (cachedRateLimitKey !== undefined) return cachedRateLimitKey if (!rateLimitKeyPromise) { - rateLimitKeyPromise = (async () => { - try { - const { env } = await import('cloudflare:workers') - return await env.RATE_LIMIT_IGNORE_KEY?.get() - } catch { - return undefined - } - })() + rateLimitKeyPromise = process.env.RATE_LIMIT_IGNORE_KEY } cachedRateLimitKey = await rateLimitKeyPromise diff --git a/apps/frontend/src/helpers/api.ts b/apps/frontend/src/helpers/api.ts index 796d8f1ec1..a9a959a0d1 100644 --- a/apps/frontend/src/helpers/api.ts +++ b/apps/frontend/src/helpers/api.ts @@ -14,14 +14,7 @@ import { import type { Ref } from 'vue' async function getRateLimitKeyFromSecretsStore(): Promise { - try { - // @ts-expect-error only avail in workers env - const { env } = await import('cloudflare:workers') - return await env.RATE_LIMIT_IGNORE_KEY?.get() - } catch { - // Not running in Cloudflare Workers environment - return undefined - } + return process.env.RATE_LIMIT_IGNORE_KEY } export function createModrinthClient(