Skip to content

Commit

Permalink
Merge branch 'canary' into og-emails
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi authored Apr 15, 2024
2 parents 2c3f5b0 + 4024a89 commit c63306b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,18 @@
"ws": "8.2.3",
"zod": "3.22.3"
},
"keywords": [
"react",
"framework",
"nextjs",
"web",
"server",
"node",
"front-end",
"back-end",
"cli",
"vercel"
],
"engines": {
"node": ">=18.17.0"
}
Expand Down
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 c63306b

Please sign in to comment.