fix(furni): keep classname env read out of the browser bundle
CI / check (push) Successful in 30s
CI / tests-unit (push) Successful in 2m0s
CI / tests-imaging-browsers (push) Successful in 2m0s
CI / tests-integration (push) Successful in 2m6s
CI / tests-ui (push) Successful in 2m41s
CI / preflight (push) Skipped
CI / tests-quality (push) Successful in 45s
CI / deploy (push) Successful in 4m11s
CI / check (push) Successful in 30s
CI / tests-unit (push) Successful in 2m0s
CI / tests-imaging-browsers (push) Successful in 2m0s
CI / tests-integration (push) Successful in 2m6s
CI / tests-ui (push) Successful in 2m41s
CI / preflight (push) Skipped
CI / tests-quality (push) Successful in 45s
CI / deploy (push) Successful in 4m11s
`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.
This commit is contained in:
1 parent
ef6c671903
commit
1e3406a7ae
1 file changed
+4
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user