fix: mark AI tool execution route as dynamic to prevent build-time WASM error
Add `export const dynamic = 'force-dynamic'` to `/api/tools/execute/[...slug]` to prevent Next.js from attempting static generation at build time. The AI SDK (used via executeToolWithAgent) requires tiktoken_bg.wasm which cannot be loaded during static generation. Marking as dynamic ensures the route is only executed at runtime. Note: This partially addresses the build error but further investigation needed for complete resolution of tiktoken WASM loading in Next.js 16 + Turbopack. Relates to: "Error: Missing tiktoken_bg.wasm" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
2ce37ae2aa
commit
140a2fa218
1 changed files with 1 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ import { type NextRequest, NextResponse } from 'next/server';
|
|||
// Use Node.js runtime for SSE streaming
|
||||
export const runtime = 'nodejs';
|
||||
export const maxDuration = 60; // 60 seconds timeout
|
||||
export const dynamic = 'force-dynamic'; // Prevent static generation for AI SDK routes
|
||||
|
||||
interface ExecuteRequest {
|
||||
prompt: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue