From b3a06e92e7cf41ed48775bc69e1d0c9f0fc1941c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Sun, 6 Nov 2022 01:57:52 +0100 Subject: [PATCH] fix: correctly mention `generateStaticParams` in error --- packages/next/build/utils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/next/build/utils.ts b/packages/next/build/utils.ts index 489aea31fd68f10..51dc98dc76d0c21 100644 --- a/packages/next/build/utils.ts +++ b/packages/next/build/utils.ts @@ -828,6 +828,7 @@ export async function buildStaticPaths({ configFileName, locales, defaultLocale, + appDir, }: { page: string getStaticPaths?: GetStaticPaths @@ -835,6 +836,7 @@ export async function buildStaticPaths({ configFileName: string locales?: string[] defaultLocale?: string + appDir?: boolean }): Promise< Omit>, 'paths'> & { paths: string[] @@ -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}]` @@ -1193,6 +1197,7 @@ export async function buildAppStaticPaths({ }, page, configFileName, + appDir: true, }) } }