Skip to content

Commit

Permalink
Fix generateBuildId type that can be async function (#28040)
Browse files Browse the repository at this point in the history
[The current documentation ensures it can be async function](https://github.com/vercel/next.js/blob/v11.1.1-canary.1/docs/api-reference/next.config.js/configuring-the-build-id.md?plain=1#L13), so this PR fixes the TypeScript type of it.
  • Loading branch information
xnuk committed Aug 12, 2021
1 parent 6403a99 commit 1552b83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/next/build/generate-build-id.ts
@@ -1,5 +1,5 @@
export async function generateBuildId(
generate: () => string | null,
generate: () => string | null | Promise<string | null>,
fallback: () => string
): Promise<string> {
let buildId = await generate()
Expand Down
2 changes: 1 addition & 1 deletion packages/next/server/config-shared.ts
Expand Up @@ -70,7 +70,7 @@ export type NextConfig = { [key: string]: any } & {
cleanDistDir?: boolean
assetPrefix?: string
useFileSystemPublicRoutes?: boolean
generateBuildId?: () => string | null
generateBuildId?: () => string | null | Promise<string | null>
generateEtags?: boolean
pageExtensions?: string[]
compress?: boolean
Expand Down

0 comments on commit 1552b83

Please sign in to comment.