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
f2d2dde5
Unverified
Commit
f2d2dde5
authored
Oct 25, 2022
by
JJ Kasper
Committed by
GitHub
Oct 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix revalidate during dev (#41772)
Fix typo `revalidate` -> `fetchRevalidate`
parent
67c802ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
static-generation-bailout.ts
packages/next/client/components/static-generation-bailout.ts
+1
-1
app-render.tsx
packages/next/server/app-render.tsx
+12
-10
page.js
test/e2e/app-dir/app-static/app/blog/[author]/page.js
+4
-1
No files found.
packages/next/client/components/static-generation-bailout.ts
View file @
f2d2dde5
...
...
@@ -10,7 +10,7 @@ export function staticGenerationBailout(reason: string) {
if
(
staticGenerationStore
?.
isStaticGeneration
)
{
// TODO: honor the dynamic: 'force-static'
if
(
staticGenerationStore
)
{
staticGenerationStore
.
r
evalidate
=
0
staticGenerationStore
.
fetchR
evalidate
=
0
}
throw
new
DynamicServerError
(
reason
)
}
...
...
packages/next/server/app-render.tsx
View file @
f2d2dde5
...
...
@@ -238,13 +238,13 @@ function patchFetch(ComponentMod: any) {
)
{
staticGenerationStore
.
fetchRevalidate
=
next
.
revalidate
// TODO: ensure this error isn't logged to the user
// seems it's slipping through currently
throw
new
DynamicServerError
(
`revalidate:
${
next
.
revalidate
}
fetch
${
input
}${
pathname
?
`
${
pathname
}
`
:
''
}
`
)
if
(
next
.
revalidate
===
0
)
{
throw
new
DynamicServerError
(
`revalidate:
${
next
.
revalidate
}
fetch
${
input
}${
pathname
?
`
${
pathname
}
`
:
''
}
`
)
}
}
if
(
hasNextConfig
)
delete
init
.
next
}
...
...
@@ -735,7 +735,9 @@ export async function renderToHTMLOrFlight(
supportsDynamicHTML
,
}
=
renderOpts
patchFetch
(
ComponentMod
)
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
patchFetch
(
ComponentMod
)
}
const
generateStaticHTML
=
supportsDynamicHTML
!==
true
const
staticGenerationAsyncStorage
=
ComponentMod
.
staticGenerationAsyncStorage
...
...
@@ -1619,9 +1621,9 @@ export async function renderToHTMLOrFlight(
;(
renderOpts
as
any
).
pageData
=
filteredFlightData
;(
renderOpts
as
any
).
revalidate
=
typeof
staticGenerationStore
?.
r
evalidate
===
'undefined'
typeof
staticGenerationStore
?.
fetchR
evalidate
===
'undefined'
?
defaultRevalidate
:
staticGenerationStore
?.
r
evalidate
:
staticGenerationStore
?.
fetchR
evalidate
return
new
RenderResult
(
htmlResult
)
}
...
...
test/e2e/app-dir/app-static/app/blog/[author]/page.js
View file @
f2d2dde5
...
...
@@ -2,7 +2,10 @@ import Link from 'next/link'
export
const
dynamicParams
=
false
export
default
function
Page
({
params
})
{
export
default
async
function
Page
({
params
})
{
await
fetch
(
'https://example.vercel.sh'
,
{
next
:
{
revalidate
:
10
},
})
return
(
<>
<
p
id
=
"page"
>
/blog/
[
author
]
<
/p
>
...
...
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