File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
packages/next/src/server/lib
test/e2e/app-dir/app-static
app/force-no-store-bailout Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -662,6 +662,7 @@ function createPatchedFetcher(
662
662
const err = new DynamicServerError ( dynamicUsageReason )
663
663
staticGenerationStore . dynamicUsageErr = err
664
664
staticGenerationStore . dynamicUsageDescription = dynamicUsageReason
665
+ throw err
665
666
}
666
667
667
668
const hasNextConfig = 'next' in init
@@ -689,6 +690,7 @@ function createPatchedFetcher(
689
690
const err = new DynamicServerError ( dynamicUsageReason )
690
691
staticGenerationStore . dynamicUsageErr = err
691
692
staticGenerationStore . dynamicUsageDescription = dynamicUsageReason
693
+ throw err
692
694
}
693
695
694
696
if ( ! staticGenerationStore . forceStatic || next . revalidate !== 0 ) {
Original file line number Diff line number Diff line change @@ -671,6 +671,8 @@ createNextDescribe(
671
671
"force-dynamic-no-prerender/[id]/page_client-reference-manifest.js",
672
672
"force-dynamic-prerender/[slug]/page.js",
673
673
"force-dynamic-prerender/[slug]/page_client-reference-manifest.js",
674
+ "force-no-store-bailout/page.js",
675
+ "force-no-store-bailout/page_client-reference-manifest.js",
674
676
"force-no-store/page.js",
675
677
"force-no-store/page_client-reference-manifest.js",
676
678
"force-static-fetch-no-store.html",
Original file line number Diff line number Diff line change
1
+ export const fetchCache = 'force-no-store'
2
+
3
+ export default async function Page ( ) {
4
+ // this should not be invoked during build as
5
+ // no-store should have it bail out
6
+ await fetch ( 'https://non-existent' , {
7
+ cache : 'no-store' ,
8
+ } )
9
+
10
+ return (
11
+ < >
12
+ < p id = "page" > /force-no-store-bailout</ p >
13
+ < p id = "now" > { Date . now ( ) } </ p >
14
+ </ >
15
+ )
16
+ }
You can’t perform that action at this time.
0 commit comments