// TODO(veil): Source mapping breaks due to double-encoding of the square
// brackets.
awaitexpect(browser).toDisplayCollapsedRedbox(`
{
"description": "Route "/no-accessed-data": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
"description": "Route "/no-accessed-data": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
"description": "Route "/no-accessed-data": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
// TODO(veil): The wrong stack frame is used for the source snippet.
// TODO(veil): Inconsistent cursor position
awaitexpect(browser).toDisplayRedbox(`
{
"description": "Attempted to call useStuff() from the server but useStuff is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.",
it('should show a collapsed redbox error',async()=>{
constbrowser=awaitnext.browser(pathname)
if(isTurbopack){
// TODO(veil): Source mapping breaks due to double-encoding of the
// square brackets.
awaitexpect(browser).toDisplayCollapsedRedbox(`
{
"description": "Route "/dynamic-metadata-error-route": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
"environmentLabel": "Server",
"label": "Console Error",
"source": null,
"stack": [
"<FIXME-file-protocol>",
"<FIXME-file-protocol>",
"LogSafely <anonymous>",
],
}
`)
}else{
awaitexpect(browser).toDisplayCollapsedRedbox(`
{
"description": "Route "/dynamic-metadata-error-route": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
"description": "Route "/dynamic-metadata-error-route": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
// This test is just here because there was a bug when dynamic metadata was used alongside another dynamic IO violation which caused the validation to be skipped.
// TODO(veil): Source mapping breaks due to double-encoding of the
// square brackets.
awaitexpect(browser).toDisplayCollapsedRedbox(`
[
{
"description": "Route "/dynamic-root": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
"description": "Route "/dynamic-root": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
"description": "Route "/sync-server-params/[slug]" used \`params.slug\`. \`params\` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis",
// TODO(veil): Source mapping breaks due to double-encoding of the
// square brackets.
awaitexpect(browser).toDisplayCollapsedRedbox(`
{
"description": "Route "/sync-server-params/[slug]" used \`params.slug\`. \`params\` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis",
"description": "Route "/sync-server-params/[slug]" used \`params.slug\`. \`params\` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis",
it('should show a collapsed redbox error',async()=>{
constbrowser=awaitnext.browser(pathname)
if(isTurbopack){
awaitexpect(browser).toDisplayCollapsedRedbox(`
{
"description": "Route "/sync-attribution/guarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client",
"description": "Route "/sync-attribution/guarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client",
"description": "Route "/sync-attribution/guarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client",
it('should show a collapsed redbox error',async()=>{
constbrowser=awaitnext.browser(pathname)
// TODO(veil): Source mapping breaks due to double-encoding of the
// square brackets.
if(isTurbopack){
awaitexpect(browser).toDisplayCollapsedRedbox(`
{
"description": "Route "/sync-attribution/unguarded-async-guarded-clientsync": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
"environmentLabel": "Server",
"label": "Console Error",
"source": null,
"stack": [
"<FIXME-file-protocol>",
"<FIXME-file-protocol>",
"LogSafely <anonymous>",
],
}
`)
{
"description": "Route "/sync-attribution/unguarded-async-guarded-clientsync": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
it('should show a collapsed redbox error',async()=>{
constbrowser=awaitnext.browser(pathname)
if(isTurbopack){
awaitexpect(browser).toDisplayCollapsedRedbox(`
{
"description": "Route "/sync-attribution/unguarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client",
"description": "Route "/sync-attribution/unguarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client",
"description": "Route "/sync-attribution/unguarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client",