Skip to content

Commit 0a3605e

Browse files
committed
Update stack snapshots
1 parent e969e64 commit 0a3605e

File tree

2 files changed

+62
-58
lines changed

2 files changed

+62
-58
lines changed

test/development/app-dir/capture-console-error-owner-stack/capture-console-error-owner-stack.test.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,21 @@ describe('app-dir - capture-console-error-owner-stack', () => {
103103
const browser = await next.browser('/rsc')
104104

105105
await expect(browser).toDisplayCollapsedRedbox(`
106-
{
107-
"description": "boom",
108-
"environmentLabel": "Server",
109-
"label": "Console Error",
110-
"source": "app/rsc/page.js (2:17) @ Page
111-
> 2 | console.error(new Error('boom'))
112-
| ^",
113-
"stack": [
114-
"Page app/rsc/page.js (2:17)",
115-
"JSON.parse <anonymous> (0:0)",
116-
"Page <anonymous> (0:0)",
117-
],
118-
}
119-
`)
106+
{
107+
"description": "boom",
108+
"environmentLabel": "Server",
109+
"label": "Console Error",
110+
"source": "app/rsc/page.js (2:17) @ Page
111+
> 2 | console.error(new Error('boom'))
112+
| ^",
113+
"stack": [
114+
"Page app/rsc/page.js (2:17)",
115+
"JSON.parse <anonymous> (0:0)",
116+
"JSON.parse <anonymous> (0:0)",
117+
"Page <anonymous> (0:0)",
118+
],
119+
}
120+
`)
120121
})
121122

122123
it('should display the error message in error event when event.error is not present', async () => {

test/development/app-dir/dynamic-io-dev-errors/dynamic-io-dev-errors.test.ts

Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,21 @@ describe('Dynamic IO Dev Errors', () => {
1313
const browser = await next.browser('/error')
1414

1515
await expect(browser).toDisplayCollapsedRedbox(`
16-
{
17-
"description": "Route "/error" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random",
18-
"environmentLabel": "Server",
19-
"label": "Console Error",
20-
"source": "app/error/page.tsx (2:23) @ Page
21-
> 2 | const random = Math.random()
22-
| ^",
23-
"stack": [
24-
"Page app/error/page.tsx (2:23)",
25-
"JSON.parse <anonymous> (0:0)",
26-
"LogSafely <anonymous> (0:0)",
27-
],
28-
}
29-
`)
16+
{
17+
"description": "Route "/error" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random",
18+
"environmentLabel": "Server",
19+
"label": "Console Error",
20+
"source": "app/error/page.tsx (2:23) @ Page
21+
> 2 | const random = Math.random()
22+
| ^",
23+
"stack": [
24+
"Page app/error/page.tsx (2:23)",
25+
"JSON.parse <anonymous> (0:0)",
26+
"JSON.parse <anonymous> (0:0)",
27+
"LogSafely <anonymous> (0:0)",
28+
],
29+
}
30+
`)
3031
})
3132

3233
it('should show a red box error on client navigations', async () => {
@@ -39,20 +40,21 @@ describe('Dynamic IO Dev Errors', () => {
3940
await browser.elementByCss("[href='/error']").click()
4041

4142
await expect(browser).toDisplayCollapsedRedbox(`
42-
{
43-
"description": "Route "/error" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random",
44-
"environmentLabel": "Server",
45-
"label": "Console Error",
46-
"source": "app/error/page.tsx (2:23) @ Page
47-
> 2 | const random = Math.random()
48-
| ^",
49-
"stack": [
50-
"Page app/error/page.tsx (2:23)",
51-
"JSON.parse <anonymous> (0:0)",
52-
"LogSafely <anonymous> (0:0)",
53-
],
54-
}
55-
`)
43+
{
44+
"description": "Route "/error" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random",
45+
"environmentLabel": "Server",
46+
"label": "Console Error",
47+
"source": "app/error/page.tsx (2:23) @ Page
48+
> 2 | const random = Math.random()
49+
| ^",
50+
"stack": [
51+
"Page app/error/page.tsx (2:23)",
52+
"JSON.parse <anonymous> (0:0)",
53+
"JSON.parse <anonymous> (0:0)",
54+
"LogSafely <anonymous> (0:0)",
55+
],
56+
}
57+
`)
5658
})
5759

5860
it('should not log unhandled rejections for persistently thrown top-level errors', async () => {
@@ -99,22 +101,23 @@ describe('Dynamic IO Dev Errors', () => {
99101
)
100102

101103
await expect(browser).toDisplayCollapsedRedbox(`
102-
{
103-
"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. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
104-
"environmentLabel": "Server",
105-
"label": "Console Error",
106-
"source": null,
107-
"stack": [
108-
"Page [Server] <anonymous> (1:22)",
109-
"main <anonymous> (1:13)",
110-
"body <anonymous> (1:13)",
111-
"html <anonymous> (1:13)",
112-
"Root [Server] <anonymous> (1:22)",
113-
"JSON.parse <anonymous> (0:0)",
114-
"LogSafely <anonymous> (0:0)",
115-
],
116-
}
117-
`)
104+
{
105+
"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. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
106+
"environmentLabel": "Server",
107+
"label": "Console Error",
108+
"source": null,
109+
"stack": [
110+
"Page [Server] <anonymous> (1:22)",
111+
"main <anonymous> (1:13)",
112+
"body <anonymous> (1:13)",
113+
"html <anonymous> (1:13)",
114+
"Root [Server] <anonymous> (1:22)",
115+
"JSON.parse <anonymous> (0:0)",
116+
"JSON.parse <anonymous> (0:0)",
117+
"LogSafely <anonymous> (0:0)",
118+
],
119+
}
120+
`)
118121
})
119122

120123
it('should clear segment errors after correcting them', async () => {

0 commit comments

Comments
 (0)