Files
ad3296b9d4 Update default error pages (#90469)
Redesign the https://github.com/vercel/next.js/pull/87988 error pages to
be more aligned with Next.js aesthetic, along with copy to be sharper.

| Client | Server |
|--------|--------|
| <img width="4992" height="2830" alt="CleanShot 2026-03-03 at 17 26
07@2x"
src="https://github.com/user-attachments/assets/f42bee3e-2ce8-44dc-9e26-79b81cf965d8"
/> | <img width="4992" height="2830" alt="CleanShot 2026-03-03 at 17 23
38@2x"
src="https://github.com/user-attachments/assets/19a596c6-6da7-4a42-9b53-16e3c2e6f867"
/> |
| <img width="4992" height="2830" alt="CleanShot 2026-03-03 at 17 25
22@2x"
src="https://github.com/user-attachments/assets/a3075d79-c76a-4fbf-af6e-d4a44f1434eb"
/> | <img width="4992" height="2830" alt="CleanShot 2026-03-03 at 17 24
17@2x"
src="https://github.com/user-attachments/assets/5811cc98-f8e4-4451-bf9c-501548292245"
/> |

---------

Co-authored-by: Jimmy Lai <[email protected]>
Co-authored-by: Tim Neutkens <[email protected]>
2026-03-04 12:49:57 +01:00

51 lines
1.4 KiB
TypeScript

import { nextTestSetup } from 'e2e-utils'
describe('serialize-circular-error', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should serialize the object from server component in console correctly', async () => {
const browser = await next.browser('/')
await expect(browser).toDisplayRedbox(`
{
"code": "E394",
"description": "An error occurred but serializing the error message failed.",
"environmentLabel": "Server",
"label": "Runtime Error",
"source": null,
"stack": [],
}
`)
const output = next.cliOutput
expect(output).toContain(
'Error: {"objA":{"other":{"a":"[Circular]"}},"objB":"[Circular]"}'
)
})
it('should serialize the object from client component in console correctly', async () => {
const browser = await next.browser('/client')
// TODO: Format arbitrary messages in Redbox
await expect(browser).toDisplayRedbox(`
{
"code": "E394",
"description": "[object Object]",
"environmentLabel": null,
"label": "Runtime Error",
"source": null,
"stack": [],
}
`)
const bodyText = await browser.elementByCss('body').text()
expect(bodyText).toContain('This page couldn\u2019t load')
const output = next.cliOutput
expect(output).toContain(
'Error: {"objC":{"other":{"a":"[Circular]"}},"objD":"[Circular]"}'
)
})
})