Unverified Commit ad482024 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Ensure force-dynamic is honored during build (#45015)

parent 04f26460
...@@ -1048,7 +1048,7 @@ export async function buildStaticPaths({ ...@@ -1048,7 +1048,7 @@ export async function buildStaticPaths({
export type AppConfig = { export type AppConfig = {
revalidate?: number | false revalidate?: number | false
dynamicParams?: true | false dynamicParams?: true | false
dynamic?: 'auto' | 'error' | 'force-static' dynamic?: 'auto' | 'error' | 'force-static' | 'force-dynamic'
fetchCache?: 'force-cache' | 'only-cache' fetchCache?: 'force-cache' | 'only-cache'
preferredRegion?: string preferredRegion?: string
} }
...@@ -1354,6 +1354,10 @@ export async function isPageStatic({ ...@@ -1354,6 +1354,10 @@ export async function isPageStatic({
{} {}
) )
if (appConfig.dynamic === 'force-dynamic') {
appConfig.revalidate = 0
}
if (isDynamicRoute(page)) { if (isDynamicRoute(page)) {
;({ ;({
paths: prerenderRoutes, paths: prerenderRoutes,
......
...@@ -46,6 +46,7 @@ createNextDescribe( ...@@ -46,6 +46,7 @@ createNextDescribe(
'dynamic-no-gen-params/[slug].html', 'dynamic-no-gen-params/[slug].html',
'dynamic-no-gen-params/[slug].rsc', 'dynamic-no-gen-params/[slug].rsc',
'dynamic-no-gen-params/[slug]/page.js', 'dynamic-no-gen-params/[slug]/page.js',
'force-dynamic-no-prerender/[id]/page.js',
'force-static/[slug]/page.js', 'force-static/[slug]/page.js',
'force-static/first.html', 'force-static/first.html',
'force-static/first.rsc', 'force-static/first.rsc',
......
export const dynamic = 'force-dynamic'
export default function Page({ params }) {
throw new Error('this should not attempt prerendering with force-dynamic')
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment