Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly mention generateStaticParams in error #42524

Merged
merged 2 commits into from Nov 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/next/build/utils.ts
Expand Up @@ -828,13 +828,15 @@ export async function buildStaticPaths({
configFileName,
locales,
defaultLocale,
appDir,
}: {
page: string
getStaticPaths?: GetStaticPaths
staticPathsResult?: UnwrapPromise<ReturnType<GetStaticPaths>>
configFileName: string
locales?: string[]
defaultLocale?: string
appDir?: boolean
}): Promise<
Omit<UnwrapPromise<ReturnType<GetStaticPaths>>, 'paths'> & {
paths: string[]
Expand Down Expand Up @@ -982,7 +984,9 @@ export async function buildStaticPaths({
throw new Error(
`A required parameter (${validParamKey}) was not provided as ${
repeat ? 'an array' : 'a string'
} in getStaticPaths for ${page}`
} in ${
appDir ? 'generateStaticParams' : 'getStaticPaths'
} for ${page}`
)
}
let replaced = `[${repeat ? '...' : ''}${validParamKey}]`
Expand Down Expand Up @@ -1193,6 +1197,7 @@ export async function buildAppStaticPaths({
},
page,
configFileName,
appDir: true,
})
}
}
Expand Down