diff --git a/lib/markdownContentFetch.ts b/lib/markdownContentFetch.ts index 686c916..b2ca93b 100644 --- a/lib/markdownContentFetch.ts +++ b/lib/markdownContentFetch.ts @@ -127,11 +127,20 @@ export async function getMarkdownFiles( // Try multiple potential paths where content might be in Vercel const potentialPaths = [ - // Standard development path - check this first - path.resolve(process.cwd(), folderName), - // Vercel standalone build paths + // Vercel standalone build paths (prioritize these since we copy content here) path.resolve(process.cwd(), ".next", "standalone", folderName), + path.resolve( + process.cwd(), + ".next", + "standalone", + "content", + folderName.replace("content/", "") + ), + // Standard development path + path.resolve(process.cwd(), folderName), + // Other Vercel paths path.resolve(process.cwd(), ".next", "server", folderName), + path.resolve(process.cwd(), ".next", folderName), // Public directory (fallback option) path.resolve(process.cwd(), "public", folderName), path.resolve(process.cwd(), ".next", "standalone", "public", folderName), @@ -142,8 +151,6 @@ export async function getMarkdownFiles( path.resolve(__dirname, "..", folderName), path.resolve(__dirname, "..", "..", folderName), path.resolve(__dirname, "..", "..", "..", folderName), - // Check in .next directory structure - path.resolve(process.cwd(), ".next", folderName), ] console.log("Trying potential paths:") diff --git a/vercel.json b/vercel.json index 1d06f39..039c6d9 100644 --- a/vercel.json +++ b/vercel.json @@ -1,8 +1,7 @@ { "functions": { "app/api/**": { - "maxDuration": 30, - "includeFiles": "content/**" + "maxDuration": 30 } }, "regions": ["iad1"], @@ -11,5 +10,6 @@ "NEXT_TELEMETRY_DISABLED": "1" } }, + "buildCommand": "next build && cp -r content .next/standalone/", "crons": [] }