Skip to content

Commit

Permalink
Merge branch 'canary' into fix-install-helper-for-pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan-Arrowood authored Apr 15, 2024
2 parents e611b0b + 4024a89 commit 3e39951
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/next/src/server/lib/patch-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ function createPatchedFetcher(
const err = new DynamicServerError(dynamicUsageReason)
staticGenerationStore.dynamicUsageErr = err
staticGenerationStore.dynamicUsageDescription = dynamicUsageReason
throw err
}

const hasNextConfig = 'next' in init
Expand Down Expand Up @@ -695,6 +696,7 @@ function createPatchedFetcher(
const err = new DynamicServerError(dynamicUsageReason)
staticGenerationStore.dynamicUsageErr = err
staticGenerationStore.dynamicUsageDescription = dynamicUsageReason
throw err
}

if (!staticGenerationStore.forceStatic || next.revalidate !== 0) {
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/app-dir/app-static/app-static.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,8 @@ createNextDescribe(
"force-dynamic-no-prerender/[id]/page_client-reference-manifest.js",
"force-dynamic-prerender/[slug]/page.js",
"force-dynamic-prerender/[slug]/page_client-reference-manifest.js",
"force-no-store-bailout/page.js",
"force-no-store-bailout/page_client-reference-manifest.js",
"force-no-store/page.js",
"force-no-store/page_client-reference-manifest.js",
"force-static-fetch-no-store.html",
Expand Down
16 changes: 16 additions & 0 deletions test/e2e/app-dir/app-static/app/force-no-store-bailout/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const fetchCache = 'force-no-store'

export default async function Page() {
// this should not be invoked during build as
// no-store should have it bail out
await fetch('https://non-existent', {
cache: 'no-store',
})

return (
<>
<p id="page">/force-no-store-bailout</p>
<p id="now">{Date.now()}</p>
</>
)
}

0 comments on commit 3e39951

Please sign in to comment.