Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1852,11 +1852,15 @@ export default async function build(
}
}

// getNextConfigRuntime only filters if experimental.runtimeServerDeploymentId is true,
// but we unconditionally want to remove configFile for this manifest
let runtimeConfigWithoutFilePath = { ...runtimeConfig }
delete (runtimeConfigWithoutFilePath as NextConfigComplete).configFile

const serverFilesManifest: RequiredServerFilesManifest = {
version: 1,
config: {
...runtimeConfig,

...runtimeConfigWithoutFilePath,
...(ciEnvironment.hasNextSupport
? {
compress: false,
Expand Down
5 changes: 5 additions & 0 deletions packages/next/src/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,11 @@ export interface NextConfigRuntime {
export function getNextConfigRuntime(
config: NextConfigComplete | NextConfigRuntime
): NextConfigRuntime {
// This config filter is a breaking change, so only do it if experimental.runtimeServerDeploymentId is enabled
if (!config.experimental.runtimeServerDeploymentId) {
return config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return config
const { configFile: _, ...configWithoutFile } = config as NextConfigComplete
return configWithoutFile as NextConfigRuntime

Type mismatch in getNextConfigRuntime: function returns NextConfigComplete with configFile property when runtimeServerDeploymentId is not enabled, violating the NextConfigRuntime return type contract

Fix on Vercel

}

let ex = config.experimental

type Requiredish<T> = {
Expand Down
Loading