Skip to content

Commit f1d91f0

Browse files
vmelikyanclaude
andcommitted
fix: use NODE_ENV for basePath to avoid runtime process error
The previous approach using process.env?.NEXT_PUBLIC_DEV_ENV causes "process is not defined" in the browser. NODE_ENV is inlined at build time by Next.js, avoiding the runtime error. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fe6aeb2 commit f1d91f0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/theme.config.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ import { Separator } from "@/components/ui/separator";
2525
import { Code } from "@/components";
2626
import Image from "next/image";
2727

28-
const isLocal = process.env?.NEXT_PUBLIC_DEV_ENV === "local";
29-
const basePath = !isLocal ? "/lifecycle-docs" : "";
28+
const basePath = process.env.NODE_ENV === "production" ? "/lifecycle-docs" : "";
3029

3130
const logo = (
3231
<div className="flex items-center gap-2 logo-shake">

0 commit comments

Comments
 (0)