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

Ensure app revalidate has correct default #42168

Merged
merged 1 commit into from Oct 30, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/next/build/index.ts
Expand Up @@ -2208,6 +2208,15 @@ export default async function build(
? appConfig.revalidate
: false
}

// ensure revalidate is normalized correctly
if (
typeof revalidate !== 'number' &&
typeof revalidate !== 'boolean'
) {
revalidate = false
}

if (revalidate !== 0) {
const normalizedRoute = normalizePagePath(route)
const dataRoute = path.posix.join(`${normalizedRoute}.rsc`)
Expand Down
@@ -1,5 +1,7 @@
import { notFound } from 'next/navigation'

export const revalidate = null

export const dynamicParams = true

export default function Page({ params }) {
Expand Down