Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Next.js 16+ · Const

preferredRegion

preferredRegion is a route-segment export that passes a preferred deployment region to the hosting platform. It is deprecated in current Next.js documentation and should be removed from route files.

How it works

preferredRegion is a route-segment export for a page, layout, or route handler. It passes a preferred deployment-region value to the hosting platform; a child segment replaces its parent’s value rather than combining with it. The setting is deprecated in current Next.js documentation, so remove it from new or existing route files.

Syntax

export const preferredRegion: string | string[]

Parameters

NameTypeDescription
preferredRegionstring | string[]A platform-specific region code, or an array of region codes; documented special values include auto, global, and home.

Returns

No runtime return value; this is a route-segment export consumed by the deployment platform.

Key points

  • It is a route-segment configuration export for controlling where the platform prefers to deploy that segment.
  • The declaration accepts either one region string or an array of region strings.
  • A single string targets one platform-specific deployment region.
  • An array targets every listed region rather than selecting only one.
  • Without a local value, the segment inherits from its closest parent layout.
  • When no ancestor supplies a value, the root layout’s documented default is auto.

Common mistakes

  • Do not add this export to new routes; remove it from existing route files and follow the deprecation guidance.
  • Nested layouts do not combine region arrays or values: the child setting wins completely.
  • Region identifiers such as iad1 are not portable; verify supported values with the deployment provider.

Example: Set a preferred deployment region

export const preferredRegion = 'iad1'

This route segment requests deployment in the platform-specific iad1 region.

When to use it

Remove an existing region preference while migrating to the current configuration model.

Legacy application maintenance

In older code, request one or more provider-supported regions for a route segment.

Provider-specific deployment control

Understand how an existing parent layout preference is inherited or replaced by a child segment.

Nested route configuration

Interview questions

QWhat does preferredRegion configure?

preferredRegion is exported from a page, layout, or route handler to pass a preferred deployment region to the deployment platform. It accepts a string or an array of strings.

Follow-up: What happens when both a parent layout and child page define it? The child value overrides the parent, and the values are not merged.

QHow do string and array values differ?

A string requests one specific platform region, while an array requests deployment to every listed region. The array is not a set from which the platform chooses one region.

Follow-up: What should determine the region names? The deployment platform’s documentation, because supported codes and behavior vary by provider.

QShould a new Next.js 16 application use this export?

Current documentation marks preferredRegion as deprecated and instructs developers to remove the export from route files. Therefore, it should not be used for new Next.js code.

Follow-up: Does the route segment configuration still list a default? Yes, the reference describes auto as the default, while the deprecation guidance means this export should be removed.

  • Route Segment Config
  • runtime
  • maxDuration
  • Route Handlers
  • Layouts
  • Pages

Source: Route Segment Config: preferredRegion (deprecated). Checked 2026-10-15.