From 1e3406a7ae3d050787bee729cbf7895cf71cb017 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 15 Oct 2026 16:39:45 +0200 Subject: [PATCH] fix(furni): keep classname env read out of the browser bundle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `src/lib/furni/classname.ts` is imported by client components for its pure string helpers, but it read `process.env.FURNI_BUNDLE_EXT` at module load. In any client bundle without a `process` shim — including the UI fixture's esbuild build — that threw `ReferenceError: process is not defined`, so the lazily-loaded organize-imports dialog never mounted and `pnpm test:ui` failed (studio.spec.ts). Fall back to the default extension when `process` is absent; server behaviour is unchanged. --- src/lib/furni/classname.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/furni/classname.ts b/src/lib/furni/classname.ts index 08ec5d0b..fce009b6 100644 --- a/src/lib/furni/classname.ts +++ b/src/lib/furni/classname.ts @@ -28,6 +28,10 @@ export type FurnitureBundleExt = (typeof BUNDLE_EXT_CHOICES)[number]; */ function readBundleExtEnv(): string | undefined { const name = "FURNI_BUNDLE_EXT"; + // `classname.ts` is also imported by client components for its pure string + // helpers, where `process` does not exist at runtime. Reading env is a + // server concern; on the client fall back to the default extension. + if (typeof process === "undefined") return undefined; return process.env[name]?.trim() || undefined; }