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
d24eeb64
Unverified
Commit
d24eeb64
authored
Apr 13, 2022
by
JJ Kasper
Committed by
GitHub
Apr 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix only generated case in minimal mode (#36130)
parent
bc40c0b5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
base-server.ts
packages/next/server/base-server.ts
+6
-1
required-server-files.test.ts
test/production/required-server-files.test.ts
+19
-0
No files found.
packages/next/server/base-server.ts
View file @
d24eeb64
...
@@ -1449,7 +1449,12 @@ export default abstract class Server {
...
@@ -1449,7 +1449,12 @@ export default abstract class Server {
// skip manual revalidate if cache is not present and
// skip manual revalidate if cache is not present and
// revalidate-if-generated is set
// revalidate-if-generated is set
if
(
isManualRevalidate
&&
revalidateOnlyGenerated
&&
!
hadCache
)
{
if
(
isManualRevalidate
&&
revalidateOnlyGenerated
&&
!
hadCache
&&
!
this
.
minimalMode
)
{
await
this
.
render404
(
req
,
res
)
await
this
.
render404
(
req
,
res
)
return
null
return
null
}
}
...
...
test/production/required-server-files.test.ts
View file @
d24eeb64
...
@@ -235,6 +235,25 @@ describe('should set-up next', () => {
...
@@ -235,6 +235,25 @@ describe('should set-up next', () => {
expect
(
props2
.
gspCalls
).
not
.
toBe
(
props
.
gspCalls
)
expect
(
props2
.
gspCalls
).
not
.
toBe
(
props
.
gspCalls
)
})
})
it
(
'should not 404 for onlyGenerated manual revalidate in minimal mode'
,
async
()
=>
{
const
previewProps
=
JSON
.
parse
(
await
next
.
readFile
(
'standalone/.next/prerender-manifest.json'
)
).
preview
const
res
=
await
fetchViaHTTP
(
appPort
,
'/optional-ssg/only-generated-1'
,
undefined
,
{
headers
:
{
'x-prerender-revalidate'
:
previewProps
.
previewModeId
,
'x-prerender-revalidate-if-generated'
:
'1'
,
},
}
)
expect
(
res
.
status
).
toBe
(
200
)
})
it
(
'should set correct SWR headers with notFound gsp'
,
async
()
=>
{
it
(
'should set correct SWR headers with notFound gsp'
,
async
()
=>
{
await
waitFor
(
2000
)
await
waitFor
(
2000
)
await
next
.
patchFile
(
'standalone/data.txt'
,
'show'
)
await
next
.
patchFile
(
'standalone/data.txt'
,
'show'
)
...
...
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