Unverified Commit b9d65b8a authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[test] Assert on all errors in Redbox matchers (#77907)

parent 29836888
...@@ -48,7 +48,6 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -48,7 +48,6 @@ describe('ReactRefreshLogBox-builtins app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'dns'", "description": "Module not found: Can't resolve 'dns'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -62,7 +61,6 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -62,7 +61,6 @@ describe('ReactRefreshLogBox-builtins app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'dns'", "description": "Module not found: Can't resolve 'dns'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -97,7 +95,6 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -97,7 +95,6 @@ describe('ReactRefreshLogBox-builtins app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'b'", "description": "Module not found: Can't resolve 'b'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -111,7 +108,6 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -111,7 +108,6 @@ describe('ReactRefreshLogBox-builtins app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'b'", "description": "Module not found: Can't resolve 'b'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -147,7 +143,6 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -147,7 +143,6 @@ describe('ReactRefreshLogBox-builtins app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'b'", "description": "Module not found: Can't resolve 'b'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -161,7 +156,6 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -161,7 +156,6 @@ describe('ReactRefreshLogBox-builtins app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'b'", "description": "Module not found: Can't resolve 'b'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -195,7 +189,6 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -195,7 +189,6 @@ describe('ReactRefreshLogBox-builtins app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve './non-existent.css'", "description": "Module not found: Can't resolve './non-existent.css'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -209,7 +202,6 @@ describe('ReactRefreshLogBox-builtins app', () => { ...@@ -209,7 +202,6 @@ describe('ReactRefreshLogBox-builtins app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve './non-existent.css'", "description": "Module not found: Can't resolve './non-existent.css'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
......
...@@ -34,7 +34,6 @@ describe('ReactRefreshLogBox app', () => { ...@@ -34,7 +34,6 @@ describe('ReactRefreshLogBox app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Ecmascript file had an error", "description": "Ecmascript file had an error",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -48,7 +47,6 @@ describe('ReactRefreshLogBox app', () => { ...@@ -48,7 +47,6 @@ describe('ReactRefreshLogBox app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x "getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching", "description": "Error: x "getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
......
...@@ -43,7 +43,6 @@ describe('Error recovery app', () => { ...@@ -43,7 +43,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -57,7 +56,6 @@ describe('Error recovery app', () => { ...@@ -57,7 +56,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Unexpected eof", "description": "Error: x Unexpected eof",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -117,7 +115,6 @@ describe('Error recovery app', () => { ...@@ -117,7 +115,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -131,7 +128,6 @@ describe('Error recovery app', () => { ...@@ -131,7 +128,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Expected '}', got '<eof>'", "description": "Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -183,7 +179,6 @@ describe('Error recovery app', () => { ...@@ -183,7 +179,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -197,7 +192,6 @@ describe('Error recovery app', () => { ...@@ -197,7 +192,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Expected '}', got '<eof>'", "description": "Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -269,7 +263,6 @@ describe('Error recovery app', () => { ...@@ -269,7 +263,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: oops", "description": "Error: oops",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -290,7 +283,6 @@ describe('Error recovery app', () => { ...@@ -290,7 +283,6 @@ describe('Error recovery app', () => {
// TODO(veil): Location of Page should be app/page.js // TODO(veil): Location of Page should be app/page.js
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: oops", "description": "Error: oops",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -385,7 +377,6 @@ describe('Error recovery app', () => { ...@@ -385,7 +377,6 @@ describe('Error recovery app', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: oops", "description": "Error: oops",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Runtime Error", "label": "Runtime Error",
...@@ -461,7 +452,6 @@ describe('Error recovery app', () => { ...@@ -461,7 +452,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: oops", "description": "Error: oops",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -478,7 +468,6 @@ describe('Error recovery app', () => { ...@@ -478,7 +468,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: oops", "description": "Error: oops",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -550,7 +539,6 @@ describe('Error recovery app', () => { ...@@ -550,7 +539,6 @@ describe('Error recovery app', () => {
await browser.eval('window.triggerError()') await browser.eval('window.triggerError()')
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: no 1", "description": "Error: no 1",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -584,7 +572,6 @@ describe('Error recovery app', () => { ...@@ -584,7 +572,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -598,7 +585,6 @@ describe('Error recovery app', () => { ...@@ -598,7 +585,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Expected '}', got '<eof>'", "description": "Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -623,7 +609,6 @@ describe('Error recovery app', () => { ...@@ -623,7 +609,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -637,7 +622,6 @@ describe('Error recovery app', () => { ...@@ -637,7 +622,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Expected '}', got '<eof>'", "description": "Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -705,7 +689,6 @@ describe('Error recovery app', () => { ...@@ -705,7 +689,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: React is not defined", "description": "Error: React is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -722,7 +705,6 @@ describe('Error recovery app', () => { ...@@ -722,7 +705,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: React is not defined", "description": "Error: React is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -795,7 +777,6 @@ describe('Error recovery app', () => { ...@@ -795,7 +777,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -809,7 +790,6 @@ describe('Error recovery app', () => { ...@@ -809,7 +790,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Expected '{', got 'return'", "description": "Error: x Expected '{', got 'return'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -853,7 +833,6 @@ describe('Error recovery app', () => { ...@@ -853,7 +833,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -867,7 +846,6 @@ describe('Error recovery app', () => { ...@@ -867,7 +846,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Expected '{', got 'throw'", "description": "Error: x Expected '{', got 'throw'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -912,7 +890,6 @@ describe('Error recovery app', () => { ...@@ -912,7 +890,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: nooo", "description": "Error: nooo",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -928,7 +905,6 @@ describe('Error recovery app', () => { ...@@ -928,7 +905,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: nooo", "description": "Error: nooo",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -954,7 +930,6 @@ describe('Error recovery app', () => { ...@@ -954,7 +930,6 @@ describe('Error recovery app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -968,7 +943,6 @@ describe('Error recovery app', () => { ...@@ -968,7 +943,6 @@ describe('Error recovery app', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Expected '}', got '<eof>'", "description": "Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
......
...@@ -23,7 +23,6 @@ describe('Error overlay - RSC runtime errors', () => { ...@@ -23,7 +23,6 @@ describe('Error overlay - RSC runtime errors', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "TypeError: useState only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/react-client-hook-in-server-component", "description": "TypeError: useState only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/react-client-hook-in-server-component",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Runtime Error", "label": "Runtime Error",
...@@ -56,7 +55,6 @@ describe('Error overlay - RSC runtime errors', () => { ...@@ -56,7 +55,6 @@ describe('Error overlay - RSC runtime errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: \`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context", "description": "Error: \`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -71,7 +69,6 @@ describe('Error overlay - RSC runtime errors', () => { ...@@ -71,7 +69,6 @@ describe('Error overlay - RSC runtime errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: \`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context", "description": "Error: \`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -100,7 +97,6 @@ describe('Error overlay - RSC runtime errors', () => { ...@@ -100,7 +97,6 @@ describe('Error overlay - RSC runtime errors', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: alert is not defined", "description": "ReferenceError: alert is not defined",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -20,7 +20,6 @@ describe('Undefined default export', () => { ...@@ -20,7 +20,6 @@ describe('Undefined default export', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: The default export is not a React Component in "/specific-path/server/page"", "description": "Error: The default export is not a React Component in "/specific-path/server/page"",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -46,7 +45,6 @@ describe('Undefined default export', () => { ...@@ -46,7 +45,6 @@ describe('Undefined default export', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: The default export is not a React Component in "/specific-path/server/layout"", "description": "Error: The default export is not a React Component in "/specific-path/server/layout"",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -75,7 +73,6 @@ describe('Undefined default export', () => { ...@@ -75,7 +73,6 @@ describe('Undefined default export', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: The default export is not a React Component in "/will-not-found/not-found"", "description": "Error: The default export is not a React Component in "/will-not-found/not-found"",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -97,7 +94,6 @@ describe('Undefined default export', () => { ...@@ -97,7 +94,6 @@ describe('Undefined default export', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: The default export is not a React Component in "/page"", "description": "Error: The default export is not a React Component in "/page"",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -122,7 +118,6 @@ describe('Undefined default export', () => { ...@@ -122,7 +118,6 @@ describe('Undefined default export', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: The default export is not a React Component in "/server-with-errors/page-export-initial-error/page"", "description": "Error: The default export is not a React Component in "/server-with-errors/page-export-initial-error/page"",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -19,7 +19,6 @@ describe('ReactRefreshLogBox _app _document', () => { ...@@ -19,7 +19,6 @@ describe('ReactRefreshLogBox _app _document', () => {
const { browser, session } = sandbox const { browser, session } = sandbox
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: The default export is not a React Component in page: "/_app"", "description": "Error: The default export is not a React Component in page: "/_app"",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -52,7 +51,6 @@ describe('ReactRefreshLogBox _app _document', () => { ...@@ -52,7 +51,6 @@ describe('ReactRefreshLogBox _app _document', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: The default export is not a React Component in page: "/_document"", "description": "Error: The default export is not a React Component in page: "/_document"",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -111,7 +109,6 @@ describe('ReactRefreshLogBox _app _document', () => { ...@@ -111,7 +109,6 @@ describe('ReactRefreshLogBox _app _document', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -125,7 +122,6 @@ describe('ReactRefreshLogBox _app _document', () => { ...@@ -125,7 +122,6 @@ describe('ReactRefreshLogBox _app _document', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"count": 1,
"description": " × Module build failed:", "description": " × Module build failed:",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -158,7 +154,6 @@ describe('ReactRefreshLogBox _app _document', () => { ...@@ -158,7 +154,6 @@ describe('ReactRefreshLogBox _app _document', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Expression expected", "description": "Error: x Expression expected",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -235,7 +230,6 @@ describe('ReactRefreshLogBox _app _document', () => { ...@@ -235,7 +230,6 @@ describe('ReactRefreshLogBox _app _document', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -249,7 +243,6 @@ describe('ReactRefreshLogBox _app _document', () => { ...@@ -249,7 +243,6 @@ describe('ReactRefreshLogBox _app _document', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"count": 1,
"description": " × Module build failed:", "description": " × Module build failed:",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -275,7 +268,6 @@ describe('ReactRefreshLogBox _app _document', () => { ...@@ -275,7 +268,6 @@ describe('ReactRefreshLogBox _app _document', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Unexpected token \`{\`. Expected identifier, string literal, numeric literal or [ for the computed key", "description": "Error: x Unexpected token \`{\`. Expected identifier, string literal, numeric literal or [ for the computed key",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
......
...@@ -47,7 +47,6 @@ describe('ReactRefreshLogBox', () => { ...@@ -47,7 +47,6 @@ describe('ReactRefreshLogBox', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'dns'", "description": "Module not found: Can't resolve 'dns'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -61,7 +60,6 @@ describe('ReactRefreshLogBox', () => { ...@@ -61,7 +60,6 @@ describe('ReactRefreshLogBox', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'dns'", "description": "Module not found: Can't resolve 'dns'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -97,7 +95,6 @@ describe('ReactRefreshLogBox', () => { ...@@ -97,7 +95,6 @@ describe('ReactRefreshLogBox', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'b'", "description": "Module not found: Can't resolve 'b'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -111,7 +108,6 @@ describe('ReactRefreshLogBox', () => { ...@@ -111,7 +108,6 @@ describe('ReactRefreshLogBox', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'b'", "description": "Module not found: Can't resolve 'b'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -147,7 +143,6 @@ describe('ReactRefreshLogBox', () => { ...@@ -147,7 +143,6 @@ describe('ReactRefreshLogBox', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'b'", "description": "Module not found: Can't resolve 'b'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -161,7 +156,6 @@ describe('ReactRefreshLogBox', () => { ...@@ -161,7 +156,6 @@ describe('ReactRefreshLogBox', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve 'b'", "description": "Module not found: Can't resolve 'b'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -204,7 +198,6 @@ describe('ReactRefreshLogBox', () => { ...@@ -204,7 +198,6 @@ describe('ReactRefreshLogBox', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve './non-existent.css'", "description": "Module not found: Can't resolve './non-existent.css'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -218,7 +211,6 @@ describe('ReactRefreshLogBox', () => { ...@@ -218,7 +211,6 @@ describe('ReactRefreshLogBox', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Module not found: Can't resolve './non-existent.css'", "description": "Module not found: Can't resolve './non-existent.css'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
......
...@@ -284,7 +284,6 @@ describe('ReactRefreshRegression', () => { ...@@ -284,7 +284,6 @@ describe('ReactRefreshRegression', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: boom", "description": "Error: boom",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -300,7 +299,6 @@ describe('ReactRefreshRegression', () => { ...@@ -300,7 +299,6 @@ describe('ReactRefreshRegression', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: boom", "description": "Error: boom",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -12,7 +12,6 @@ describe('app-dir - capture-console-error-owner-stack', () => { ...@@ -12,7 +12,6 @@ describe('app-dir - capture-console-error-owner-stack', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "trigger an console <error>", "description": "trigger an console <error>",
"environmentLabel": null, "environmentLabel": null,
"label": "Console Error", "label": "Console Error",
...@@ -33,7 +32,6 @@ describe('app-dir - capture-console-error-owner-stack', () => { ...@@ -33,7 +32,6 @@ describe('app-dir - capture-console-error-owner-stack', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "trigger an console.error in render", "description": "trigger an console.error in render",
"environmentLabel": null, "environmentLabel": null,
"label": "Console Error", "label": "Console Error",
...@@ -52,7 +50,6 @@ describe('app-dir - capture-console-error-owner-stack', () => { ...@@ -52,7 +50,6 @@ describe('app-dir - capture-console-error-owner-stack', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "trigger an console.error in render", "description": "trigger an console.error in render",
"environmentLabel": null, "environmentLabel": null,
"label": "Console Error", "label": "Console Error",
...@@ -71,7 +68,6 @@ describe('app-dir - capture-console-error-owner-stack', () => { ...@@ -71,7 +68,6 @@ describe('app-dir - capture-console-error-owner-stack', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "ssr console error:client", "description": "ssr console error:client",
"environmentLabel": null, "environmentLabel": null,
"label": "Console Error", "label": "Console Error",
...@@ -90,7 +86,6 @@ describe('app-dir - capture-console-error-owner-stack', () => { ...@@ -90,7 +86,6 @@ describe('app-dir - capture-console-error-owner-stack', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: page error", "description": "Error: page error",
"environmentLabel": null, "environmentLabel": null,
"label": "Console Error", "label": "Console Error",
...@@ -109,7 +104,6 @@ describe('app-dir - capture-console-error-owner-stack', () => { ...@@ -109,7 +104,6 @@ describe('app-dir - capture-console-error-owner-stack', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: boom", "description": "Error: boom",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Console Error", "label": "Console Error",
......
...@@ -13,7 +13,6 @@ describe('app dir - dynamic error trace', () => { ...@@ -13,7 +13,6 @@ describe('app dir - dynamic error trace', () => {
// TODO(veil): Where is the stackframe for app/page.js? // TODO(veil): Where is the stackframe for app/page.js?
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Route / with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering", "description": "Error: Route / with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -14,7 +14,6 @@ describe('Dynamic IO Dev Errors', () => { ...@@ -14,7 +14,6 @@ describe('Dynamic IO Dev Errors', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: 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", "description": "Error: 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",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Console Error", "label": "Console Error",
...@@ -41,7 +40,6 @@ describe('Dynamic IO Dev Errors', () => { ...@@ -41,7 +40,6 @@ describe('Dynamic IO Dev Errors', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: 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", "description": "Error: 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",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Console Error", "label": "Console Error",
...@@ -102,7 +100,6 @@ describe('Dynamic IO Dev Errors', () => { ...@@ -102,7 +100,6 @@ describe('Dynamic IO Dev Errors', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: 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", "description": "Error: 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",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Console Error", "label": "Console Error",
...@@ -141,7 +138,6 @@ describe('Dynamic IO Dev Errors', () => { ...@@ -141,7 +138,6 @@ describe('Dynamic IO Dev Errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Ecmascript file had an error", "description": "Ecmascript file had an error",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -155,7 +151,6 @@ describe('Dynamic IO Dev Errors', () => { ...@@ -155,7 +151,6 @@ describe('Dynamic IO Dev Errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Route segment config "revalidate" is not compatible with \`nextConfig.experimental.dynamicIO\`. Please remove it.", "description": "Error: x Route segment config "revalidate" is not compatible with \`nextConfig.experimental.dynamicIO\`. Please remove it.",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
......
...@@ -15,14 +15,22 @@ describe('app-dir - async-client-component', () => { ...@@ -15,14 +15,22 @@ describe('app-dir - async-client-component', () => {
// Ideally, it would be issued from the async Component instead but that's // Ideally, it would be issued from the async Component instead but that's
// harder to implement. // harder to implement.
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ [
"count": 2, {
"description": "<Page> is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding \`'use client'\` to a module that was originally written for the server.", "description": "<Page> is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding \`'use client'\` to a module that was originally written for the server.",
"environmentLabel": null, "environmentLabel": null,
"label": "Console Error", "label": "Console Error",
"source": null, "source": null,
"stack": [], "stack": [],
} },
{
"description": "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.",
"environmentLabel": null,
"label": "Console Error",
"source": null,
"stack": [],
},
]
`) `)
}) })
......
...@@ -12,7 +12,6 @@ describe('hook-function-names', () => { ...@@ -12,7 +12,6 @@ describe('hook-function-names', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: Kaputt!", "description": "Error: Kaputt!",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -34,7 +33,6 @@ describe('hook-function-names', () => { ...@@ -34,7 +33,6 @@ describe('hook-function-names', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: error in useEffect", "description": "Error: error in useEffect",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -25,7 +25,6 @@ describe('app-dir - missing required html tags', () => { ...@@ -25,7 +25,6 @@ describe('app-dir - missing required html tags', () => {
await assertHasRedbox(browser) await assertHasRedbox(browser)
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Missing <html> and <body> tags in the root layout. "description": "Error: Missing <html> and <body> tags in the root layout.
Read more at https://nextjs.org/docs/messages/missing-root-layout-tags", Read more at https://nextjs.org/docs/messages/missing-root-layout-tags",
"environmentLabel": null, "environmentLabel": null,
...@@ -47,7 +46,6 @@ describe('app-dir - missing required html tags', () => { ...@@ -47,7 +46,6 @@ describe('app-dir - missing required html tags', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Missing <html> tags in the root layout. "description": "Error: Missing <html> tags in the root layout.
Read more at https://nextjs.org/docs/messages/missing-root-layout-tags", Read more at https://nextjs.org/docs/messages/missing-root-layout-tags",
"environmentLabel": null, "environmentLabel": null,
......
...@@ -10,7 +10,6 @@ describe('app-dir - owner-stack-invalid-element-type', () => { ...@@ -10,7 +10,6 @@ describe('app-dir - owner-stack-invalid-element-type', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. "description": "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of \`BrowserOnly\`.", Check the render method of \`BrowserOnly\`.",
...@@ -33,7 +32,6 @@ describe('app-dir - owner-stack-invalid-element-type', () => { ...@@ -33,7 +32,6 @@ describe('app-dir - owner-stack-invalid-element-type', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. "description": "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of \`Inner\`.", Check the render method of \`Inner\`.",
...@@ -55,7 +53,6 @@ describe('app-dir - owner-stack-invalid-element-type', () => { ...@@ -55,7 +53,6 @@ describe('app-dir - owner-stack-invalid-element-type', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. "description": "Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of \`Inner\`.", Check the render method of \`Inner\`.",
......
...@@ -55,7 +55,6 @@ describe('app-dir - owner-stack', () => { ...@@ -55,7 +55,6 @@ describe('app-dir - owner-stack', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: browser error", "description": "Error: browser error",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -92,7 +91,6 @@ describe('app-dir - owner-stack', () => { ...@@ -92,7 +91,6 @@ describe('app-dir - owner-stack', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: browser error", "description": "Error: browser error",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -141,7 +139,6 @@ describe('app-dir - owner-stack', () => { ...@@ -141,7 +139,6 @@ describe('app-dir - owner-stack', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: ssr error", "description": "Error: ssr error",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -171,7 +168,6 @@ describe('app-dir - owner-stack', () => { ...@@ -171,7 +168,6 @@ describe('app-dir - owner-stack', () => {
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: string in rejected promise", "description": "Error: string in rejected promise",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -12,7 +12,6 @@ describe('server-navigation-error', () => { ...@@ -12,7 +12,6 @@ describe('server-navigation-error', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Next.js navigation API is not allowed to be used in Pages Router.", "description": "Error: Next.js navigation API is not allowed to be used in Pages Router.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -27,7 +26,6 @@ describe('server-navigation-error', () => { ...@@ -27,7 +26,6 @@ describe('server-navigation-error', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Next.js navigation API is not allowed to be used in Pages Router.", "description": "Error: Next.js navigation API is not allowed to be used in Pages Router.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -48,7 +46,6 @@ describe('server-navigation-error', () => { ...@@ -48,7 +46,6 @@ describe('server-navigation-error', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Next.js navigation API is not allowed to be used in Pages Router.", "description": "Error: Next.js navigation API is not allowed to be used in Pages Router.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -63,7 +60,6 @@ describe('server-navigation-error', () => { ...@@ -63,7 +60,6 @@ describe('server-navigation-error', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Next.js navigation API is not allowed to be used in Pages Router.", "description": "Error: Next.js navigation API is not allowed to be used in Pages Router.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -89,7 +85,6 @@ describe('server-navigation-error', () => { ...@@ -89,7 +85,6 @@ describe('server-navigation-error', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Next.js navigation API is not allowed to be used in Middleware.", "description": "Error: Next.js navigation API is not allowed to be used in Middleware.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -104,7 +99,6 @@ describe('server-navigation-error', () => { ...@@ -104,7 +99,6 @@ describe('server-navigation-error', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Next.js navigation API is not allowed to be used in Middleware.", "description": "Error: Next.js navigation API is not allowed to be used in Middleware.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -126,7 +120,6 @@ describe('server-navigation-error', () => { ...@@ -126,7 +120,6 @@ describe('server-navigation-error', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Next.js navigation API is not allowed to be used in Middleware.", "description": "Error: Next.js navigation API is not allowed to be used in Middleware.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -141,7 +134,6 @@ describe('server-navigation-error', () => { ...@@ -141,7 +134,6 @@ describe('server-navigation-error', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Next.js navigation API is not allowed to be used in Middleware.", "description": "Error: Next.js navigation API is not allowed to be used in Middleware.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -12,7 +12,6 @@ describe('ssr-only-error', () => { ...@@ -12,7 +12,6 @@ describe('ssr-only-error', () => {
// TODO(veil): Missing Owner Stack // TODO(veil): Missing Owner Stack
await expect(browser).toDisplayCollapsedRedbox(` await expect(browser).toDisplayCollapsedRedbox(`
{ {
"count": 1,
"description": "Error: SSR only error", "description": "Error: SSR only error",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -274,7 +274,6 @@ describe('GS(S)P Server-Side Change Reloading', () => { ...@@ -274,7 +274,6 @@ describe('GS(S)P Server-Side Change Reloading', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Additional keys were returned from \`getStaticProps\`. Properties intended for your component must be nested under the \`props\` key, e.g.: "description": "Error: Additional keys were returned from \`getStaticProps\`. Properties intended for your component must be nested under the \`props\` key, e.g.:
return { props: { title: 'My Title', content: '...' } } return { props: { title: 'My Title', content: '...' } }
...@@ -316,7 +315,6 @@ describe('GS(S)P Server-Side Change Reloading', () => { ...@@ -316,7 +315,6 @@ describe('GS(S)P Server-Side Change Reloading', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: custom oops", "description": "Error: custom oops",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -54,7 +54,6 @@ describe('middleware - development errors', () => { ...@@ -54,7 +54,6 @@ describe('middleware - development errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: boom", "description": "Error: boom",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -70,7 +69,6 @@ describe('middleware - development errors', () => { ...@@ -70,7 +69,6 @@ describe('middleware - development errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: boom", "description": "Error: boom",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -204,7 +202,6 @@ describe('middleware - development errors', () => { ...@@ -204,7 +202,6 @@ describe('middleware - development errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: test is not defined", "description": "ReferenceError: test is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -221,7 +218,6 @@ describe('middleware - development errors', () => { ...@@ -221,7 +218,6 @@ describe('middleware - development errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: test is not defined", "description": "ReferenceError: test is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -289,7 +285,6 @@ describe('middleware - development errors', () => { ...@@ -289,7 +285,6 @@ describe('middleware - development errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: booooom!", "description": "Error: booooom!",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -304,7 +299,6 @@ describe('middleware - development errors', () => { ...@@ -304,7 +299,6 @@ describe('middleware - development errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: booooom!", "description": "Error: booooom!",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -432,7 +426,6 @@ describe('middleware - development errors', () => { ...@@ -432,7 +426,6 @@ describe('middleware - development errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -446,7 +439,6 @@ describe('middleware - development errors', () => { ...@@ -446,7 +439,6 @@ describe('middleware - development errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Expected '{', got '}'", "description": "Error: x Expected '{', got '}'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -500,7 +492,6 @@ describe('middleware - development errors', () => { ...@@ -500,7 +492,6 @@ describe('middleware - development errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
...@@ -514,7 +505,6 @@ describe('middleware - development errors', () => { ...@@ -514,7 +505,6 @@ describe('middleware - development errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: x Expected '{', got '}'", "description": "Error: x Expected '{', got '}'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
......
...@@ -267,7 +267,6 @@ describe('Client Navigation', () => { ...@@ -267,7 +267,6 @@ describe('Client Navigation', () => {
await browser.elementByCss('#empty-props').click() await browser.elementByCss('#empty-props').click()
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: "EmptyInitialPropsPage.getInitialProps()" should resolve to an object. But found "null" instead.", "description": "Error: "EmptyInitialPropsPage.getInitialProps()" should resolve to an object. But found "null" instead.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -1252,9 +1251,43 @@ describe('Client Navigation', () => { ...@@ -1252,9 +1251,43 @@ describe('Client Navigation', () => {
await retry(async () => { await retry(async () => {
expect(await getRedboxTotalErrorCount(browser)).toBe(isReact18 ? 3 : 1) expect(await getRedboxTotalErrorCount(browser)).toBe(isReact18 ? 3 : 1)
}) })
await expect(browser).toDisplayRedbox(` if (isReact18) {
await expect(browser).toDisplayRedbox(`
[
{
"description": "Error: An Expected error occurred",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/error-inside-browser-page.js (5:13) @ ErrorInRenderPage.render
> 5 | throw new Error('An Expected error occurred')
| ^",
"stack": [
"ErrorInRenderPage.render pages/error-inside-browser-page.js (5:13)",
],
},
{
"description": "Error: An Expected error occurred",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/error-inside-browser-page.js (5:13) @ ErrorInRenderPage.render
> 5 | throw new Error('An Expected error occurred')
| ^",
"stack": [
"ErrorInRenderPage.render pages/error-inside-browser-page.js (5:13)",
],
},
{
"description": "Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.",
"environmentLabel": null,
"label": "Runtime Error",
"source": null,
"stack": [],
},
]
`)
} else {
await expect(browser).toDisplayRedbox(`
{ {
"count": ${isReact18 ? 3 : 1},
"description": "Error: An Expected error occurred", "description": "Error: An Expected error occurred",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -1266,6 +1299,7 @@ describe('Client Navigation', () => { ...@@ -1266,6 +1299,7 @@ describe('Client Navigation', () => {
], ],
} }
`) `)
}
expect(pageErrors).toEqual( expect(pageErrors).toEqual(
isReact18 isReact18
? [ ? [
...@@ -1298,7 +1332,6 @@ describe('Client Navigation', () => { ...@@ -1298,7 +1332,6 @@ describe('Client Navigation', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: An Expected error occurred", "description": "Error: An Expected error occurred",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -1313,7 +1346,6 @@ describe('Client Navigation', () => { ...@@ -1313,7 +1346,6 @@ describe('Client Navigation', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: An Expected error occurred", "description": "Error: An Expected error occurred",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -131,7 +131,6 @@ describe('Client Navigation rendering', () => { ...@@ -131,7 +131,6 @@ describe('Client Navigation rendering', () => {
if (isReact18 && isTurbopack) { if (isReact18 && isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Circular structure in "getInitialProps" result of page "/circular-json-error". https://nextjs.org/docs/messages/circular-structure", "description": "Error: Circular structure in "getInitialProps" result of page "/circular-json-error". https://nextjs.org/docs/messages/circular-structure",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -144,7 +143,6 @@ describe('Client Navigation rendering', () => { ...@@ -144,7 +143,6 @@ describe('Client Navigation rendering', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Circular structure in "getInitialProps" result of page "/circular-json-error". https://nextjs.org/docs/messages/circular-structure", "description": "Error: Circular structure in "getInitialProps" result of page "/circular-json-error". https://nextjs.org/docs/messages/circular-structure",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -163,7 +161,6 @@ describe('Client Navigation rendering', () => { ...@@ -163,7 +161,6 @@ describe('Client Navigation rendering', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: "InstanceInitialPropsPage.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.", "description": "Error: "InstanceInitialPropsPage.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -178,7 +175,6 @@ describe('Client Navigation rendering', () => { ...@@ -178,7 +175,6 @@ describe('Client Navigation rendering', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: "EmptyInitialPropsPage.getInitialProps()" should resolve to an object. But found "null" instead.", "description": "Error: "EmptyInitialPropsPage.getInitialProps()" should resolve to an object. But found "null" instead.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -222,7 +218,6 @@ describe('Client Navigation rendering', () => { ...@@ -222,7 +218,6 @@ describe('Client Navigation rendering', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: The default export is not a React Component in page: "/no-default-export"", "description": "Error: The default export is not a React Component in page: "/no-default-export"",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -238,7 +233,6 @@ describe('Client Navigation rendering', () => { ...@@ -238,7 +233,6 @@ describe('Client Navigation rendering', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: This is an expected error", "description": "Error: This is an expected error",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -254,7 +248,6 @@ describe('Client Navigation rendering', () => { ...@@ -254,7 +248,6 @@ describe('Client Navigation rendering', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: This is an expected error", "description": "Error: This is an expected error",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -278,7 +271,6 @@ describe('Client Navigation rendering', () => { ...@@ -278,7 +271,6 @@ describe('Client Navigation rendering', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: aa is not defined", "description": "ReferenceError: aa is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -294,7 +286,6 @@ describe('Client Navigation rendering', () => { ...@@ -294,7 +286,6 @@ describe('Client Navigation rendering', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: aa is not defined", "description": "ReferenceError: aa is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -422,7 +413,6 @@ describe('Client Navigation rendering', () => { ...@@ -422,7 +413,6 @@ describe('Client Navigation rendering', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: An undefined error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined", "description": "Error: An undefined error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -176,7 +176,6 @@ describe('app-dir - errors', () => { ...@@ -176,7 +176,6 @@ describe('app-dir - errors', () => {
if (isNextDev) { if (isNextDev) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: this is a test", "description": "Error: this is a test",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -216,7 +215,6 @@ describe('app-dir - errors', () => { ...@@ -216,7 +215,6 @@ describe('app-dir - errors', () => {
if (isNextDev) { if (isNextDev) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: custom server error", "description": "Error: custom server error",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -15,7 +15,6 @@ describe('app dir - global-error - error-in-global-error', () => { ...@@ -15,7 +15,6 @@ describe('app dir - global-error - error-in-global-error', () => {
await assertHasRedbox(browser) await assertHasRedbox(browser)
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: error in page", "description": "Error: error in page",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -40,19 +39,31 @@ describe('app dir - global-error - error-in-global-error', () => { ...@@ -40,19 +39,31 @@ describe('app dir - global-error - error-in-global-error', () => {
if (isNextDev) { if (isNextDev) {
await assertHasRedbox(browser) await assertHasRedbox(browser)
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ [
"count": 2, {
"description": "Error: error in global error", "description": "Error: error in global error",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
"source": "app/global-error.js (10:11) @ InnerGlobalError "source": "app/global-error.js (10:11) @ InnerGlobalError
> 10 | throw new Error('error in global error') > 10 | throw new Error('error in global error')
| ^", | ^",
"stack": [ "stack": [
"InnerGlobalError app/global-error.js (10:11)", "InnerGlobalError app/global-error.js (10:11)",
"GlobalError app/global-error.js (26:7)", "GlobalError app/global-error.js (26:7)",
], ],
} },
{
"description": "Error: error in page",
"environmentLabel": null,
"label": "Runtime Error",
"source": "app/page.js (7:11) @ Page.useEffect
> 7 | throw new Error('error in page')
| ^",
"stack": [
"Page.useEffect app/page.js (7:11)",
],
},
]
`) `)
} }
}) })
......
...@@ -218,7 +218,6 @@ describe('app-dir - server source maps', () => { ...@@ -218,7 +218,6 @@ describe('app-dir - server source maps', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Boom", "description": "Error: Boom",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -16,7 +16,6 @@ describe('next-link', () => { ...@@ -16,7 +16,6 @@ describe('next-link', () => {
// TODO(veil): https://linear.app/vercel/issue/NDX-554/hide-the-anonymous-frames-which-are-between-2-ignored-frames // TODO(veil): https://linear.app/vercel/issue/NDX-554/hide-the-anonymous-frames-which-are-between-2-ignored-frames
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Failed prop type: The prop \`href\` expects a \`string\` or \`object\` in \`<Link>\`, but got \`undefined\` instead. "description": "Error: Failed prop type: The prop \`href\` expects a \`string\` or \`object\` in \`<Link>\`, but got \`undefined\` instead.
Open your browser's console to view the Component stack trace.", Open your browser's console to view the Component stack trace.",
"environmentLabel": null, "environmentLabel": null,
...@@ -43,7 +42,6 @@ describe('next-link', () => { ...@@ -43,7 +42,6 @@ describe('next-link', () => {
// TODO(veil): https://linear.app/vercel/issue/NDX-554/hide-the-anonymous-frames-which-are-between-2-ignored-frames // TODO(veil): https://linear.app/vercel/issue/NDX-554/hide-the-anonymous-frames-which-are-between-2-ignored-frames
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: No children were passed to <Link> with \`href\` of \`/about\` but one child is required https://nextjs.org/docs/messages/link-no-children", "description": "Error: No children were passed to <Link> with \`href\` of \`/about\` but one child is required https://nextjs.org/docs/messages/link-no-children",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -68,7 +66,6 @@ describe('next-link', () => { ...@@ -68,7 +66,6 @@ describe('next-link', () => {
// TODO(veil): https://linear.app/vercel/issue/NDX-554/hide-the-anonymous-frames-which-are-between-2-ignored-frames // TODO(veil): https://linear.app/vercel/issue/NDX-554/hide-the-anonymous-frames-which-are-between-2-ignored-frames
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "Error: Multiple children were passed to <Link> with \`href\` of \`/\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children "description": "Error: Multiple children were passed to <Link> with \`href\` of \`/\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children
Open your browser's console to view the Component stack trace.", Open your browser's console to view the Component stack trace.",
"environmentLabel": null, "environmentLabel": null,
......
...@@ -90,7 +90,6 @@ describe('server-side dev errors', () => { ...@@ -90,7 +90,6 @@ describe('server-side dev errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -105,7 +104,6 @@ describe('server-side dev errors', () => { ...@@ -105,7 +104,6 @@ describe('server-side dev errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -169,7 +167,6 @@ describe('server-side dev errors', () => { ...@@ -169,7 +167,6 @@ describe('server-side dev errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -184,7 +181,6 @@ describe('server-side dev errors', () => { ...@@ -184,7 +181,6 @@ describe('server-side dev errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -248,7 +244,6 @@ describe('server-side dev errors', () => { ...@@ -248,7 +244,6 @@ describe('server-side dev errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -263,7 +258,6 @@ describe('server-side dev errors', () => { ...@@ -263,7 +258,6 @@ describe('server-side dev errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -326,7 +320,6 @@ describe('server-side dev errors', () => { ...@@ -326,7 +320,6 @@ describe('server-side dev errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -341,7 +334,6 @@ describe('server-side dev errors', () => { ...@@ -341,7 +334,6 @@ describe('server-side dev errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -360,7 +352,6 @@ describe('server-side dev errors', () => { ...@@ -360,7 +352,6 @@ describe('server-side dev errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -375,7 +366,6 @@ describe('server-side dev errors', () => { ...@@ -375,7 +366,6 @@ describe('server-side dev errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -438,7 +428,6 @@ describe('server-side dev errors', () => { ...@@ -438,7 +428,6 @@ describe('server-side dev errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -453,7 +442,6 @@ describe('server-side dev errors', () => { ...@@ -453,7 +442,6 @@ describe('server-side dev errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -472,7 +460,6 @@ describe('server-side dev errors', () => { ...@@ -472,7 +460,6 @@ describe('server-side dev errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -487,7 +474,6 @@ describe('server-side dev errors', () => { ...@@ -487,7 +474,6 @@ describe('server-side dev errors', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"count": 1,
"description": "ReferenceError: missingVar is not defined", "description": "ReferenceError: missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
......
...@@ -62,37 +62,28 @@ declare global { ...@@ -62,37 +62,28 @@ declare global {
} }
} }
interface RedboxSnapshot { interface ErrorSnapshot {
environmentLabel: string environmentLabel: string
label: string label: string
description: string description: string
componentStack?: string componentStack?: string
source: string source: string
stack: string[] stack: string[]
count: number
} }
async function createRedboxSnapshot( async function createErrorSnapshot(
browser: BrowserInterface, browser: BrowserInterface,
next: NextInstance | null next: NextInstance | null
): Promise<RedboxSnapshot> { ): Promise<ErrorSnapshot> {
const [ const [label, environmentLabel, description, source, stack, componentStack] =
label, await Promise.all([
environmentLabel, getRedboxLabel(browser),
description, getRedboxEnvironmentLabel(browser),
source, getRedboxDescription(browser),
stack, getRedboxSource(browser),
componentStack, getRedboxCallStack(browser),
count, getRedboxComponentStack(browser),
] = await Promise.all([ ])
getRedboxLabel(browser),
getRedboxEnvironmentLabel(browser),
getRedboxDescription(browser),
getRedboxSource(browser),
getRedboxCallStack(browser),
getRedboxComponentStack(browser),
getRedboxTotalErrorCount(browser),
])
// We don't need to test the codeframe logic everywhere. // We don't need to test the codeframe logic everywhere.
// Here we focus on the cursor position of the top most frame // Here we focus on the cursor position of the top most frame
...@@ -145,7 +136,7 @@ async function createRedboxSnapshot( ...@@ -145,7 +136,7 @@ async function createRedboxSnapshot(
} }
} }
const snapshot: RedboxSnapshot = { const snapshot: ErrorSnapshot = {
environmentLabel, environmentLabel,
label, label,
description: description:
...@@ -159,8 +150,6 @@ async function createRedboxSnapshot( ...@@ -159,8 +150,6 @@ async function createRedboxSnapshot(
return stackframe.replace(next.testDir, '<FIXME-project-root>') return stackframe.replace(next.testDir, '<FIXME-project-root>')
}) })
: stack, : stack,
// TODO(newDevOverlay): Always return `count`. Normalizing currently to avoid assertion forks.
count: label === 'Build Error' && count === -1 ? 1 : count,
} }
// Hydration diffs are only relevant to some specific errors // Hydration diffs are only relevant to some specific errors
...@@ -172,6 +161,38 @@ async function createRedboxSnapshot( ...@@ -172,6 +161,38 @@ async function createRedboxSnapshot(
return snapshot return snapshot
} }
type RedboxSnapshot = ErrorSnapshot | ErrorSnapshot[]
async function createRedboxSnapshot(
browser: BrowserInterface,
next: NextInstance | null
): Promise<RedboxSnapshot> {
const errorTally = await getRedboxTotalErrorCount(browser)
const errorSnapshots: ErrorSnapshot[] = []
for (let errorIndex = 0; errorIndex < errorTally; errorIndex++) {
const errorSnapshot = await createErrorSnapshot(browser, next)
errorSnapshots.push(errorSnapshot)
if (errorIndex < errorTally - 1) {
// Go to next error
await browser
.waitForElementByCss('[data-nextjs-dialog-error-next]')
.click()
// TODO: Wait for suspended content if the click triggered it.
await browser.waitForElementByCss(
`[data-nextjs-dialog-error-index="${errorIndex + 1}"]`
)
}
}
return errorSnapshots.length === 1
? // Most of the Redbox tests will just show a single error.
// We optimize display for that case.
errorSnapshots[0]
: errorSnapshots
}
expect.extend({ expect.extend({
async toDisplayRedbox( async toDisplayRedbox(
this: MatcherContext, this: MatcherContext,
......
...@@ -934,27 +934,6 @@ export async function openRedbox(browser: BrowserInterface): Promise<void> { ...@@ -934,27 +934,6 @@ export async function openRedbox(browser: BrowserInterface): Promise<void> {
await assertHasRedbox(browser) await assertHasRedbox(browser)
} }
export async function goToNextErrorView(
browser: BrowserInterface
): Promise<void> {
try {
const currentErrorIndex = await browser
.elementByCss('[data-nextjs-dialog-error-index]')
.text()
await browser.elementByCss('[data-nextjs-dialog-error-next]').click()
await retry(async () => {
const nextErrorIndex = await browser
.elementByCss('[data-nextjs-dialog-error-index]')
.text()
expect(nextErrorIndex).not.toBe(currentErrorIndex)
})
} catch (cause) {
const error = new Error('No Redbox to open.', { cause })
Error.captureStackTrace(error, openRedbox)
throw error
}
}
export async function openDevToolsIndicatorPopover( export async function openDevToolsIndicatorPopover(
browser: BrowserInterface browser: BrowserInterface
): Promise<void> { ): Promise<void> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment