From 8db117dab5ddeb640ed32b0409bc61ef8b833227 Mon Sep 17 00:00:00 2001 From: Ada0116 Date: Mon, 18 May 2026 23:46:58 +0800 Subject: [PATCH] fix: remove output export to support dynamic SSE route --- app/api/chat/[chatId]/route.ts | 1 + app/api/chat/route.ts | 1 + app/api/get_session/route.ts | 1 - next.config.ts | 4 +--- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/api/chat/[chatId]/route.ts b/app/api/chat/[chatId]/route.ts index 890367c..0d15789 100644 --- a/app/api/chat/[chatId]/route.ts +++ b/app/api/chat/[chatId]/route.ts @@ -1,4 +1,5 @@ import { NextRequest, NextResponse } from 'next/server'; +export const dynamic = 'force-dynamic'; const MOCK_STREAM_EVENTS = [ { id: "mock-1", data: { type: "reasoning", stage: "start", content: "Agent started" } }, diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index ac48725..cef2558 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -1,4 +1,5 @@ import { NextRequest, NextResponse } from 'next/server'; +export const dynamic = 'force-dynamic'; const MOCK_STREAM_EVENTS = [ { id: "mock-1", data: { type: "reasoning", stage: "start", content: "Agent started" } }, diff --git a/app/api/get_session/route.ts b/app/api/get_session/route.ts index 9a1a2ce..41b92b3 100644 --- a/app/api/get_session/route.ts +++ b/app/api/get_session/route.ts @@ -1,5 +1,4 @@ import { NextRequest, NextResponse } from 'next/server'; - export const dynamic = 'force-dynamic'; export async function GET(request: NextRequest) { diff --git a/next.config.ts b/next.config.ts index 32278a2..872f9bc 100644 --- a/next.config.ts +++ b/next.config.ts @@ -3,8 +3,6 @@ import type { NextConfig } from "next"; const isDevMode = process.env.NODE_ENV === 'development'; const nextConfig: NextConfig = { - // Only use static export in production - ...(isDevMode ? {} : { output: 'export' }), trailingSlash: true, // Images configuration @@ -44,4 +42,4 @@ const nextConfig: NextConfig = { }), }; -export default nextConfig; +export default nextConfig; \ No newline at end of file