Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(web): defer MULTICA_API_URL check to runtime in next.config

yushen276e9a5b2519
diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts
index 8250f6260b..6d192d4295 100644
--- a/apps/web/next.config.ts
+++ b/apps/web/next.config.ts
@@ -1,17 +1,17 @@
import type { NextConfig } from "next";
-if (!process.env.MULTICA_API_URL) {
- throw new Error("MULTICA_API_URL is required");
-}
-
const nextConfig: NextConfig = {
transpilePackages: ["@multica/ui", "@multica/store", "@multica/hooks", "@multica/sdk"],
- rewrites: async () => [
- {
- source: "/api/:path*",
- destination: `${process.env.MULTICA_API_URL}/api/:path*`,
- },
- ],
+ rewrites: async () => {
+ const apiUrl = process.env.MULTICA_API_URL;
+ if (!apiUrl) return [];
+ return [
+ {
+ source: "/api/:path*",
+ destination: `${apiUrl}/api/:path*`,
+ },
+ ];
+ },
headers: async () => [
{
source: "/sw.js",