{"record":{"id":"da16a3b65d4d5206","repo":"withastro/astro","slug":"maxduration-is-set-to-maxduration-seconds-whic","errorCode":null,"errorMessage":"maxDuration is set to ${maxDuration} seconds, which is longer than the maximum allowed duration of 900 seconds.","messagePattern":"maxDuration is set to (.+?) seconds, which is longer than the maximum allowed duration of 900 seconds\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/integrations/vercel/src/index.ts","lineNumber":347,"sourceCode":"\t\t\t\t\t},\n\t\t\t\t\t...getAstroImageConfig(\n\t\t\t\t\t\timageService,\n\t\t\t\t\t\timagesConfig,\n\t\t\t\t\t\tcommand,\n\t\t\t\t\t\tdevImageService,\n\t\t\t\t\t\tconfig.image,\n\t\t\t\t\t),\n\t\t\t\t});\n\t\t\t},\n\t\t\t'astro:routes:resolved': (params) => {\n\t\t\t\troutes = params.routes;\n\t\t\t},\n\t\t\t'astro:config:done': ({ setAdapter, config, logger, buildOutput }) => {\n\t\t\t\t_buildOutput = buildOutput;\n\n\t\t\t\tif (_buildOutput === 'server') {\n\t\t\t\t\tif (maxDuration && maxDuration > 900) {\n\t\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t\t`maxDuration is set to ${maxDuration} seconds, which is longer than the maximum allowed duration of 900 seconds.`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t\t`Please make sure that your plan allows for this duration. See https://vercel.com/docs/functions/serverless-functions/runtimes#maxduration for more information.`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tconst vercelConfigPath = new URL('vercel.json', config.root);\n\t\t\t\t\tif (\n\t\t\t\t\t\tconfig.trailingSlash &&\n\t\t\t\t\t\tconfig.trailingSlash !== 'ignore' &&\n\t\t\t\t\t\texistsSync(vercelConfigPath)\n\t\t\t\t\t) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst vercelConfig = JSON.parse(readFileSync(vercelConfigPath, 'utf-8'));\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(vercelConfig.trailingSlash === true && config.trailingSlash === 'never') ||\n\t\t\t\t\t\t\t\t(vercelConfig.trailingSlash === false && config.trailingSlash === 'always')\n\t\t\t\t\t\t\t) {","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/withastro/astro/blob/3578d45d34226d63cff3d261c971c221de6794d2/packages/integrations/vercel/src/index.ts#L329-L365","documentation":"In its astro:config:done hook (server output only), the Vercel adapter validates the maxDuration option against Vercel's hard ceiling of 900 seconds for serverless functions. A larger value is accepted by the adapter but exceeds what most Vercel plans allow, so this warning (plus a follow-up about plans) is printed to flag that function execution may be cut off or the deployment may fail on Vercel's side.","triggerScenarios":" vercel({ maxDuration: 1800 }) (any value > 900) with output: 'server' in astro.config; the condition maxDuration && maxDuration > 900 is true during astro:config:done.","commonSituations":" Long-running SSR work (large renders, external crawls, AI/LLM streaming) configured with generous timeouts; copying maxDuration from AWS Lambda configs where the limit is higher (up to 15 min); Pro/Enterprise users assuming 800s+ defaults without checking the plan.","solutions":["Lower maxDuration to 900 or less: vercel({ maxDuration: 900 }).","If you genuinely need longer work, move it to a Vercel Cron Job, Fluid Compute, or a queued background function instead of one serverless invocation.","Check your Vercel plan's actual per-function limit via the linked runtimes#maxduration doc and set maxDuration within it.","Re-run astro build; the warning should no longer print."],"exampleFix":"// before\nexport default defineConfig({\n  output: 'server',\n  adapter: vercel({ maxDuration: 1800 }),\n});\n\n// after\nexport default defineConfig({\n  output: 'server',\n  adapter: vercel({ maxDuration: 900 }),\n});","handlingStrategy":"validation","validationCode":"const MAX_ALLOWED = 900;\nconst safeDuration = (requested: number): number =>\n  Math.min(requested, MAX_ALLOWED);\nconst adapter = vercel({ maxDuration: safeDuration(1200) }); // -> 900","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cap maxDuration at 900 unless the Vercel plan document says otherwise.","Move work longer than the limit to cron jobs or queued background functions.","Check the adapter's SUPPORTED limits in its README after major upgrades."],"tags":["vercel","maxduration","timeout","serverless","limits"],"backgroundTag":"function-duration-limit-exceeded","analyzedSha":"3578d45d34226d63cff3d261c971c221de6794d2","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}