Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
ad482024
Unverified
Commit
ad482024
authored
Jan 18, 2023
by
JJ Kasper
Committed by
GitHub
Jan 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure force-dynamic is honored during build (#45015)
parent
04f26460
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
utils.ts
packages/next/src/build/utils.ts
+5
-1
app-static.test.ts
test/e2e/app-dir/app-static/app-static.test.ts
+1
-0
page.js
...ir/app-static/app/force-dynamic-no-prerender/[id]/page.js
+5
-0
No files found.
packages/next/src/build/utils.ts
View file @
ad482024
...
...
@@ -1048,7 +1048,7 @@ export async function buildStaticPaths({
export
type
AppConfig
=
{
revalidate
?:
number
|
false
dynamicParams
?:
true
|
false
dynamic
?:
'auto'
|
'error'
|
'force-static'
dynamic
?:
'auto'
|
'error'
|
'force-static'
|
'force-dynamic'
fetchCache
?:
'force-cache'
|
'only-cache'
preferredRegion
?:
string
}
...
...
@@ -1354,6 +1354,10 @@ export async function isPageStatic({
{}
)
if
(
appConfig
.
dynamic
===
'force-dynamic'
)
{
appConfig
.
revalidate
=
0
}
if
(
isDynamicRoute
(
page
))
{
;({
paths
:
prerenderRoutes
,
...
...
test/e2e/app-dir/app-static/app-static.test.ts
View file @
ad482024
...
...
@@ -46,6 +46,7 @@ createNextDescribe(
'dynamic-no-gen-params/[slug].html'
,
'dynamic-no-gen-params/[slug].rsc'
,
'dynamic-no-gen-params/[slug]/page.js'
,
'force-dynamic-no-prerender/[id]/page.js'
,
'force-static/[slug]/page.js'
,
'force-static/first.html'
,
'force-static/first.rsc'
,
...
...
test/e2e/app-dir/app-static/app/force-dynamic-no-prerender/[id]/page.js
0 → 100644
View file @
ad482024
export
const
dynamic
=
'force-dynamic'
export
default
function
Page
({
params
})
{
throw
new
Error
(
'this should not attempt prerendering with force-dynamic'
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment