From a8755811b5577842547a63f04ddd22cb49189038 Mon Sep 17 00:00:00 2001 From: mlogclub Date: Sat, 13 Jun 2026 10:46:20 +0800 Subject: [PATCH] fix: update backendBaseUrl in next.config.ts to prioritize NEXT_API_BASE_URL --- Makefile | 2 +- web/next.config.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b4440ed..78abc6a 100644 --- a/Makefile +++ b/Makefile @@ -173,7 +173,7 @@ _web-build-spa: @cd $(WEB_DIR) && $(PNPM) build:sdk && $(PNPM) build _web-dev: - @cd $(WEB_DIR) && NEXT_PUBLIC_API_BASE_URL="$(DEV_API_BASE_URL)" $(PNPM) dev + @cd $(WEB_DIR) && NEXT_PUBLIC_API_BASE_URL="" NEXT_API_BASE_URL="$(DEV_API_BASE_URL)" $(PNPM) dev _prepare-dist: @mkdir -p $(DIST_DIR) diff --git a/web/next.config.ts b/web/next.config.ts index 25ca8a0..3feb8bd 100644 --- a/web/next.config.ts +++ b/web/next.config.ts @@ -2,7 +2,9 @@ import type { NextConfig } from "next" import { PHASE_DEVELOPMENT_SERVER } from "next/constants" const backendBaseUrl = - process.env.NEXT_PUBLIC_API_BASE_URL?.trim() || "http://127.0.0.1:8083" + process.env.NEXT_API_BASE_URL?.trim() || + process.env.NEXT_PUBLIC_API_BASE_URL?.trim() || + "http://127.0.0.1:8083" const productionBasePath = "" export default function nextConfig(phase: string): NextConfig {