Skip to content

Commit 5f75d22

Browse files
ijjkmischnic
andauthored
backport: Only filter next config if experimental flag is enabled (#88733) (#88772)
Backports #88733 Co-authored-by: Niklas Mischkulnig <[email protected]>
1 parent f01cf07 commit 5f75d22

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/next/src/build/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,11 +1852,15 @@ export default async function build(
18521852
}
18531853
}
18541854

1855+
// getNextConfigRuntime only filters if experimental.runtimeServerDeploymentId is true,
1856+
// but we unconditionally want to remove configFile for this manifest
1857+
let runtimeConfigWithoutFilePath = { ...runtimeConfig }
1858+
delete (runtimeConfigWithoutFilePath as NextConfigComplete).configFile
1859+
18551860
const serverFilesManifest: RequiredServerFilesManifest = {
18561861
version: 1,
18571862
config: {
1858-
...runtimeConfig,
1859-
1863+
...runtimeConfigWithoutFilePath,
18601864
...(ciEnvironment.hasNextSupport
18611865
? {
18621866
compress: false,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,11 @@ export interface NextConfigRuntime {
16831683
export function getNextConfigRuntime(
16841684
config: NextConfigComplete | NextConfigRuntime
16851685
): NextConfigRuntime {
1686+
// This config filter is a breaking change, so only do it if experimental.runtimeServerDeploymentId is enabled
1687+
if (!config.experimental.runtimeServerDeploymentId) {
1688+
return config
1689+
}
1690+
16861691
let ex = config.experimental
16871692

16881693
type Requiredish<T> = {

0 commit comments

Comments
 (0)