Skip to content

Commit 50a8179

Browse files
committed
Add deprecation warning to Runtime config
1 parent 642ae3e commit 50a8179

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/next/src/server/config-shared.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,13 +1119,15 @@ export interface NextConfig {
11191119
* Add public (in browser) runtime configuration to your app
11201120
*
11211121
* @see [Runtime configuration](https://nextjs.org/docs/pages/api-reference/config/next-config-js/runtime-configuration
1122+
* @deprecated Runtime config is deprecated and will be removed in Next.js 16.
11221123
*/
11231124
publicRuntimeConfig?: { [key: string]: any }
11241125

11251126
/**
11261127
* Add server runtime configuration to your app
11271128
*
11281129
* @see [Runtime configuration](https://nextjs.org/docs/pages/api-reference/config/next-config-js/runtime-configuration
1130+
* @deprecated Runtime config is deprecated and will be removed in Next.js 16.
11291131
*/
11301132
serverRuntimeConfig?: { [key: string]: any }
11311133

packages/next/src/server/config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,19 @@ function checkDeprecations(
109109
silent: boolean,
110110
dir: string
111111
) {
112+
warnOptionHasBeenDeprecated(
113+
userConfig,
114+
'publicRuntimeConfig',
115+
`Runtime config is deprecated and the \`publicRuntimeConfig\` configuration option will be removed in Next.js 16.`,
116+
silent
117+
)
118+
warnOptionHasBeenDeprecated(
119+
userConfig,
120+
'serverRuntimeConfig',
121+
`Runtime config is deprecated and the \`serverRuntimeConfig\` configuration option will be removed in Next.js 16.`,
122+
silent
123+
)
124+
112125
if (userConfig.experimental?.dynamicIO !== undefined) {
113126
warnOptionHasBeenDeprecated(
114127
userConfig,

0 commit comments

Comments
 (0)