Skip to content

Commit

Permalink
fix prerendering
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Feb 22, 2023
1 parent 68d335d commit b854804
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1435,22 +1435,11 @@ export default async function build(
isSsg = true
}

const isDynamic = isDynamicRoute(page)
const isDynamicPageWithoutGenerateStaticParams =
isDynamic && !workerResult.prerenderRoutes

if (workerResult.appConfig?.revalidate !== 0) {
if (!isDynamic) {
if (!isDynamicRoute(page)) {
appStaticPaths.set(originalAppPath, [page])
appStaticPathsEncoded.set(originalAppPath, [page])
isStatic = true
} else if (isDynamicPageWithoutGenerateStaticParams) {
// Do not prerender with the empty slug name if there
// is no generateStaticParams provided.
// https://github.com/vercel/next.js/issues/45850
appStaticPaths.set(originalAppPath, [])
appStaticPathsEncoded.set(originalAppPath, [])
isStatic = true
}
}

Expand Down

0 comments on commit b854804

Please sign in to comment.