Remove an existing region preference while migrating to the current configuration model.
Legacy application maintenance
Next.js 16+ · Const
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.
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.
export const preferredRegion: string | string[]| Name | Type | Description |
|---|---|---|
preferredRegion | string | string[] | A platform-specific region code, or an array of region codes; documented special values include auto, global, and home. |
No runtime return value; this is a route-segment export consumed by the deployment platform.
auto.iad1 are not portable; verify supported values with the deployment provider.export const preferredRegion = 'iad1'This route segment requests deployment in the platform-specific iad1 region.
Legacy application maintenance
Provider-specific deployment control
Nested route configuration
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.
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.
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 ConfigruntimemaxDurationRoute HandlersLayoutsPages