withastro/astro · warning

Please make sure that your plan allows for this duration. Se

Error message

Please make sure that your plan allows for this duration. See https://vercel.com/docs/functions/serverless-functions/runtimes#maxduration for more information.

What it means

Companion warning printed immediately after the 'maxDuration is set to N seconds...' message by the Vercel adapter's astro:config:done hook. It does not indicate a separate problem: it points out that values above 900 seconds are only honored on Vercel plans that allow them, and links to the runtimes#maxduration documentation. The adapter still writes your maxDuration into the generated function config.

Source

Thrown at packages/integrations/vercel/src/index.ts:350

						imagesConfig,
						command,
						devImageService,
						config.image,
					),
				});
			},
			'astro:routes:resolved': (params) => {
				routes = params.routes;
			},
			'astro:config:done': ({ setAdapter, config, logger, buildOutput }) => {
				_buildOutput = buildOutput;

				if (_buildOutput === 'server') {
					if (maxDuration && maxDuration > 900) {
						logger.warn(
							`maxDuration is set to ${maxDuration} seconds, which is longer than the maximum allowed duration of 900 seconds.`,
						);
						logger.warn(
							`Please make sure that your plan allows for this duration. See https://vercel.com/docs/functions/serverless-functions/runtimes#maxduration for more information.`,
						);
					}
					const vercelConfigPath = new URL('vercel.json', config.root);
					if (
						config.trailingSlash &&
						config.trailingSlash !== 'ignore' &&
						existsSync(vercelConfigPath)
					) {
						try {
							const vercelConfig = JSON.parse(readFileSync(vercelConfigPath, 'utf-8'));
							if (
								(vercelConfig.trailingSlash === true && config.trailingSlash === 'never') ||
								(vercelConfig.trailingSlash === false && config.trailingSlash === 'always')
							) {
								logger.error(
									`
	Your "vercel.json" \`trailingSlash\` configuration (set to \`${vercelConfig.trailingSlash}\`) will conflict with your Astro \`trailingSlash\` configuration (set to \`${JSON.stringify(config.trailingSlash)}\`).

View on GitHub (pinned to 3578d45d34)

Solutions

  1. Cap maxDuration at 900 unless your Vercel plan explicitly supports more.
  2. Verify your plan's limit at the linked doc (vercel.com/docs/functions/serverless-functions/runtimes#maxduration) before keeping a larger value.
  3. Refactor work longer than the limit into queued/background processing (cron, fluid compute, task queue).

Example fix

// before
vercel({ maxDuration: 1200 }), // plan only allows 900

// after
vercel({ maxDuration: 900 }),
Defensive patterns

Strategy: validation

Validate before calling

const PLAN_MAX_DURATION = 900; // confirm against https://vercel.com/docs/functions/serverless-functions/runtimes#maxduration
if (maxDuration > PLAN_MAX_DURATION) {
  console.warn(`Clamping maxDuration from ${maxDuration} to ${PLAN_MAX_DURATION}`);
  maxDuration = PLAN_MAX_DURATION;
}

Prevention

When it happens

Trigger: Always co-emitted when output: 'server' and maxDuration > 900 on the vercel() adapter options; appears as the second logger.warn inside the same if block.

Common situations: Same situations as the first maxDuration warning: migrated Lambda timeouts, long SSR/AI requests, or Enterprise users who can legitimately exceed 900s but should confirm plan support.

Related errors


AI-assisted analysis of withastro/astro@3578d45d34 (2026-08-18). Data as JSON: /api/errors/cf0204756c857e35. Report an issue: GitHub.