From 772538ddbac67c888daccc261532e0006753a4bb Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 15 Apr 2026 23:21:40 +0800 Subject: [PATCH] fix(frontend): add skills API rewrite rule to prevent HTML fallback (#2241) Fixes #2203 When NEXT_PUBLIC_BACKEND_BASE_URL is not set, the frontend uses Next.js rewrites to proxy API calls to the gateway. Skills API routes were missing from the rewrite config, causing /api/skills to return the SPA HTML instead of JSON, which produced 'Unexpected token <' errors in the skill settings page. Co-authored-by: JasonOA888 --- frontend/next.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/next.config.js b/frontend/next.config.js index 67bb8cd22..6d08b3cba 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -52,6 +52,14 @@ const config = { source: "/api/agents/:path*", destination: `${gatewayURL}/api/agents/:path*`, }); + rewrites.push({ + source: "/api/skills", + destination: `${gatewayURL}/api/skills`, + }); + rewrites.push({ + source: "/api/skills/:path*", + destination: `${gatewayURL}/api/skills/:path*`, + }); } return rewrites;