You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Error: Route "/suspense-in-root/blocking-attribution/dynamic-then-dynamic": Next.js encountered uncached data during prerendering or a navigation.
3142
+
3143
+
\`fetch(...)\` or \`connection()\` accessed outside of \`<Suspense>\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.
3144
+
3145
+
Ways to fix this:
3146
+
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
Build-time instant validation failed for route "/suspense-in-root/blocking-attribution/dynamic-then-dynamic".
3156
+
To get a more detailed stack trace and pinpoint the issue, try one of the following:
3157
+
- Start the app in development mode by running \`next dev\`, then open "/suspense-in-root/blocking-attribution/dynamic-then-dynamic" in your browser to investigate the error.
3158
+
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.
3159
+
Stopping prerender due to instant validation errors."
3160
+
`)
3161
+
expect(result.exitCode).toBe(1)
3162
+
}
3163
+
})
3164
+
3165
+
it('runtime data then dynamic data',async()=>{
3166
+
// TODO(instant-validation): Arguably, we should point to `await cookies()` first,
3167
+
// but due to our the discriminated error message strategy we favor holes that are still
3168
+
// present in the runtime retry render. This can be confusing if we have runtime and then dynamic data
3169
+
// in the same place. At least we can assert that we're pointing to the first await that was blocking in the runtime stage.
"Error: Route "/suspense-in-root/blocking-attribution/runtime-then-dynamic": Next.js encountered uncached data during prerendering or a navigation.
3209
+
3210
+
\`fetch(...)\` or \`connection()\` accessed outside of \`<Suspense>\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.
3211
+
3212
+
Ways to fix this:
3213
+
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
Build-time instant validation failed for route "/suspense-in-root/blocking-attribution/runtime-then-dynamic".
3223
+
To get a more detailed stack trace and pinpoint the issue, try one of the following:
3224
+
- Start the app in development mode by running \`next dev\`, then open "/suspense-in-root/blocking-attribution/runtime-then-dynamic" in your browser to investigate the error.
3225
+
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.
3226
+
Stopping prerender due to instant validation errors."
3227
+
`)
3228
+
expect(result.exitCode).toBe(1)
3229
+
}
3230
+
})
3231
+
3232
+
it('(failing) runtime data in static segment when a runtime prefetchable segment is also present',async()=>{
3233
+
// TODO(instant-validation): This test is here to show a problem with our implementation.
3234
+
// If an 'allow-runtime' segment is in the tree, instant-validation.tsx has to use the runtime
3235
+
// stage for the `endTime` (which cuts off debug info and prevents us from pointing beyond the first blocking await).
3236
+
// `endTime` is ultimately shared across the whole render, which means that we'll show "too much" for the static segment
3237
+
// and end up pointing to the second await instead of the first one.
"Error: Route "/suspense-in-root/blocking-attribution/runtime-in-static/[slug]": Next.js encountered runtime data during prerendering or a navigation.
3275
+
3276
+
\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`<Suspense>\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.
3277
+
3278
+
Ways to fix this:
3279
+
- [stream] Provide a placeholder with \`<Suspense fallback={...}>\` around the data access
Build-time instant validation failed for route "/suspense-in-root/blocking-attribution/runtime-in-static/[slug]".
3289
+
To get a more detailed stack trace and pinpoint the issue, try one of the following:
3290
+
- Start the app in development mode by running \`next dev\`, then open "/suspense-in-root/blocking-attribution/runtime-in-static/[slug]" in your browser to investigate the error.
3291
+
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.
3292
+
Stopping prerender due to instant validation errors."
3293
+
`)
3294
+
expect(result.exitCode).toBe(1)
3295
+
}
3296
+
})
3297
+
})
3298
+
3096
3299
describe('config depth preference',()=>{
3097
3300
// When multiple slots have instant configs at different depths,
3098
3301
// the deepest config is preferred as the root cause. At equal
0 commit comments