8000 [dynamicIO] Avoid timeout errors with dynamic params in `"use cache"`… · vercel/next.js@5136f8e · GitHub
[go: up one dir, main page]

Skip to content

Commit 5136f8e

Browse files
authored
[dynamicIO] Avoid timeout errors with dynamic params in "use cache" (#78882)
1 parent 6440778 commit 5136f8e

File tree

33 files changed

+824
-264
lines changed

33 files changed

+824
-264
lines changed

.changeset/tricky-planes-worry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"next": patch
3+
---
4+
5+
[dynamicIO] Avoid timeout errors with dynamic params in `"use cache"`

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
< 6D47 /tr>
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
// singleton modules should always use "*.external" instead of "*-instance"
6060
"packages/next/src/server/app-render/action-async-storage-instance.ts",
6161
"packages/next/src/server/app-render/after-task-async-storage-instance.ts",
62+
"packages/next/src/server/app-render/dynamic-access-async-storage-instance.ts",
6263
"packages/next/src/server/app-render/work-async-storage-instance.ts",
6364
"packages/next/src/server/app-render/work-unit-async-storage-instance.ts",
6465
"packages/next/src/client/components/segment-cache-impl/*"

packages/next/errors.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,5 +682,7 @@
682682
"681": "Dynamic imports should not be instrumented in the edge runtime, because `dynamicIO` doesn't support it",
683683
"682": "\\`experimental.ppr\\` can not be \\`%s\\` when \\`experimental.dynamicIO\\` is \\`true\\`. PPR is implicitly enabled when Dynamic IO is enabled.",
684684
"683": "The \\`compiler.define\\` option is configured to replace the \\`%s\\` variable. This variable is either part of a Next.js built-in or is already configured.",
685-
"684": "The \\`compiler.defineServer\\` option is configured to replace the \\`%s\\` variable. This variable is either part of a Next.js built-in or is already configured."
685+
"684": "The \\`compiler.defineServer\\` option is configured to replace the \\`%s\\` variable. This variable is either part of a Next.js built-in or is already configured.",
686+
"685": "Accessed fallback \\`params\\` during prerendering.",
687+
"686": "Expected clientReferenceManifest to be defined."
686688
}

packages/next/src/build/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,8 +2683,7 @@ export default async function build(
26832683
_isDynamicError: isDynamicError,
26842684
_isAppDir: true,
26852685
_isRoutePPREnabled: isRoutePPREnabled,
2686-
_doNotThrowOnEmptyStaticShell:
2687-
!route.throwOnEmptyStaticShell,
2686+
_allowEmptyStaticShell: !route.throwOnEmptyStaticShell,
26882687
}
26892688
})
26902689
})

packages/next/src/build/webpack-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const browserNonTranspileModules = [
133133
const precompileRegex = /[\\/]next[\\/]dist[\\/]compiled[\\/]/
134134

135135
const asyncStoragesRegex =
136-
/next[\\/]dist[\\/](esm[\\/])?server[\\/]app-render[\\/](work-async-storage|action-async-storage|work-unit-async-storage)/
136+
/next[\\/]dist[\\/](esm[\\/])?se F04D rver[\\/]app-render[\\/](work-async-storage|action-async-storage|dynamic-access-async-storage|work-unit-async-storage)/
137137

138138
// Support for NODE_PATH
139139
const nodePathList = (process.env.NODE_PATH || '')

packages/next/src/export/worker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ async function exportPageImpl(
104104
// the renderOpts.
105105
_isRoutePPREnabled: isRoutePPREnabled,
106106

107-
// Configure the rendering of the page not to throw if an empty static shell
108-
// is generated while rendering using PPR.
109-
_doNotThrowOnEmptyStaticShell: doNotThrowOnEmptyStaticShell = false,
107+
// Configure the rendering of the page to allow that an empty static shell
108+
// is generated while rendering using PPR and Dynamic IO.
109+
_allowEmptyStaticShell: allowEmptyStaticShell = false,
110110

111111
// Pull the original query out.
112112
query: originalQuery = {},
@@ -266,7 +266,7 @@ async function exportPageImpl(
266266
// If it's static, then it won't affect anything.
267267
// If it's dynamic, then it can be handled when request hits the route.
268268
serveStreamingMetadata: true,
269-
doNotThrowOnEmptyStaticShell,
269+
allowEmptyStaticShell,
270270
experimental: {
271271
...input.renderOpts.experimental,
272272
isRoutePPREnabled,

0 commit comments

Comments
 (0)
0