Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
6aa0ee81
Commit
6aa0ee81
authored
Feb 12, 2026
by
Luke Sandberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test snapshots for error message formatting changes
parent
fc6e3f90
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
77 deletions
+51
-77
ReactRefreshLogBox.test.ts
test/development/acceptance/ReactRefreshLogBox.test.ts
+11
-19
hydration-error.test.ts
test/development/acceptance/hydration-error.test.ts
+0
-12
index.test.ts
test/development/pages-dir/client-navigation/index.test.ts
+18
-19
cache-components-segment-configs.test.ts
...-segment-configs/cache-components-segment-configs.test.ts
+2
-2
index.test.ts
test/integration/server-side-dev-errors/test/index.test.ts
+10
-21
build-output-prerender.test.ts
...dir/build-output-prerender/build-output-prerender.test.ts
+10
-4
No files found.
test/development/acceptance/ReactRefreshLogBox.test.ts
View file @
6aa0ee81
...
...
@@ -743,13 +743,13 @@ describe('ReactRefreshLogBox', () => {
}
else
{
await
expect
({
browser
,
next
}).
toDisplayRedbox
(
`
{
"description": "
Parsing CSS source code faile
d",
"description": "
Syntax error: <FIXME-project-root>/index.module.css Unknown wor
d",
"environmentLabel": null,
"label": "Build Error",
"source": "./
test/tmp/next-test-1770762033409-692/index.module.css (1:8
)
Parsing CSS source code faile
d
"source": "./
index.module.css (1:1
)
Syntax error: <FIXME-project-root>/index.module.css Unknown wor
d
> 1 | .button
|
^",
| ^",
"stack": [],
}
`
)
...
...
@@ -804,21 +804,13 @@ describe('ReactRefreshLogBox', () => {
}
else
{
await
expect
({
browser
,
next
}).
toDisplayRedbox
(
`
{
"description": "
Transforming CSS failed
",
"description": "
Syntax error: Selector "button" is not pure (pure selectors must contain at least one local class or id)
",
"environmentLabel": null,
"label": "Build Error",
"source": "./test/tmp/next-test-1770762033409-692/index.module.css
Transforming CSS failed
Selector "button" is not pure. Pure selectors must contain at least one local class or id.
Import traces:
Browser:
./test/tmp/next-test-1770762033409-692/index.module.css
./test/tmp/next-test-1770762033409-692/index.js
./test/tmp/next-test-1770762033409-692/pages/index.js
SSR:
./test/tmp/next-test-1770762033409-692/index.module.css
./test/tmp/next-test-1770762033409-692/index.js
./test/tmp/next-test-1770762033409-692/pages/index.js",
"source": "./index.module.css (1:1)
Syntax error: Selector "button" is not pure (pure selectors must contain at least one local class or id)
> 1 | button {}
| ^",
"stack": [],
}
`
)
...
...
@@ -1430,11 +1422,11 @@ describe('ReactRefreshLogBox', () => {
"description": "anonymous error!",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/index.js (3:11) @
<unknown>
"source": "pages/index.js (3:11) @
eval
> 3 | throw new Error("anonymous error!");
| ^",
"stack": [
"
<unknown>
pages/index.js (3:11)",
"
eval
pages/index.js (3:11)",
"Array.map <anonymous>",
"Page pages/index.js (2:13)",
],
...
...
test/development/acceptance/hydration-error.test.ts
View file @
6aa0ee81
...
...
@@ -123,7 +123,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"main <anonymous>",
"Mismatch index.js (5:9)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -227,7 +226,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"main <anonymous>",
"Mismatch index.js (5:20)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -321,7 +319,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"div <anonymous>",
"Mismatch index.js (4:5)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -394,7 +391,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"div <anonymous>",
"Mismatch index.js (4:5)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -465,7 +461,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"div <anonymous>",
"Mismatch index.js (3:10)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -558,7 +553,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"table <anonymous>",
"Page index.js (3:5)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -646,7 +640,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"table <anonymous>",
"Page index.js (3:5)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -742,7 +735,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"main <anonymous>",
"Mismatch index.js (8:22)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -863,7 +855,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"p <anonymous>",
"Page index.js (4:7)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -959,7 +950,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"div <anonymous>",
"Page index.js (6:11)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -1043,7 +1033,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"tr <anonymous>",
"Page index.js (2:15)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
@@ -1141,7 +1130,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [
"p <anonymous>",
"Page index.js (3:32)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
],
}
`
)
...
...
test/development/pages-dir/client-navigation/index.test.ts
View file @
6aa0ee81
...
...
@@ -33,17 +33,8 @@ describe('Client Navigation', () => {
"description": ""EmptyInitialPropsPage.getInitialProps()" should resolve to an object. But found "null" instead.",
"environmentLabel": null,
"label": "Runtime Error",
"source": "../../../packages/next/src/shared/lib/utils.ts (397:11) @ loadGetInitialProps
> 397 | throw new Error(message)
| ^",
"stack": [
"loadGetInitialProps ../../../packages/next/src/shared/lib/utils.ts (397:11)",
"async App.appGetInitialProps ../../../packages/next/src/pages/_app.tsx (30:21)",
"async loadGetInitialProps ../../../packages/next/src/shared/lib/utils.ts (387:17)",
"async ../../../packages/next/src/shared/lib/router/router.ts (2221:18)",
"async Router.getRouteInfo ../../../packages/next/src/shared/lib/router/router.ts (2189:35)",
"async Router.change ../../../packages/next/src/shared/lib/router/router.ts (1595:23)",
],
"source": null,
"stack": [],
}
`
)
expect
(
pageErrors
).
toEqual
([
...
...
@@ -315,11 +306,15 @@ describe('Client Navigation', () => {
}
else
{
await
expect
(
browser
).
toDisplayRedbox
(
`
{
"description": "
Cannot read properties of null (reading 'useInsertionEffect')
",
"description": "
An Expected error occurred
",
"environmentLabel": null,
"label": "Runtime TypeError",
"source": null,
"stack": [],
"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)",
],
}
`
)
}
...
...
@@ -355,11 +350,15 @@ describe('Client Navigation', () => {
if
(
isTurbopack
)
{
await
expect
(
browser
).
toDisplayRedbox
(
`
{
"description": "
Cannot read properties of null (reading 'useInsertionEffect')
",
"description": "
An Expected error occurred
",
"environmentLabel": null,
"label": "Runtime TypeError",
"source": null,
"stack": [],
"label": "Runtime Error",
"source": "pages/error-in-the-browser-global-scope.js (2:9) @ module evaluation
> 2 | throw new Error('An Expected error occurred')
| ^",
"stack": [
"module evaluation pages/error-in-the-browser-global-scope.js (2:9)",
],
}
`
)
}
else
if
(
isRspack
)
{
...
...
test/e2e/app-dir/cache-components-segment-configs/cache-components-segment-configs.test.ts
View file @
6aa0ee81
...
...
@@ -38,7 +38,7 @@ describe('cache-components-segment-configs', () => {
)
}
else
{
expect
(
redbox
.
description
).
toMatchInlineSnapshot
(
`"Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."`
`"
x
Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."`
)
}
expect
(
redbox
.
source
).
toContain
(
...
...
@@ -99,7 +99,7 @@ describe('cache-components-segment-configs', () => {
)
}
else
{
expect
(
redbox
.
description
).
toMatchInlineSnapshot
(
`"
Route segment config "revalidat
e" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."`
`"
x Route segment config "runtim
e" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."`
)
}
expect
(
redbox
.
source
).
toContain
(
...
...
test/integration/server-side-dev-errors/test/index.test.ts
View file @
6aa0ee81
...
...
@@ -88,14 +88,11 @@ describe('server-side dev errors', () => {
"description": "missingVar is not defined",
"environmentLabel": null,
"label": "Runtime ReferenceError",
"source": "
../../test/integration/server-side-dev-errors/
pages/gsp.js (6:3) @ getStaticProps
"source": "pages/gsp.js (6:3) @ getStaticProps
> 6 | missingVar;return {
| ^",
"stack": [
"getStaticProps ../../test/integration/server-side-dev-errors/pages/gsp.js (6:3)",
"async doRender src/server/route-modules/pages/pages-handler.ts (244:22)",
"async handleResponse src/server/route-modules/pages/pages-handler.ts (539:24)",
"async Module.handler src/server/route-modules/pages/pages-handler.ts (760:9)",
"getStaticProps pages/gsp.js (6:3)",
],
}
`
)
...
...
@@ -141,14 +138,11 @@ describe('server-side dev errors', () => {
"description": "missingVar is not defined",
"environmentLabel": null,
"label": "Runtime ReferenceError",
"source": "
../../test/integration/server-side-dev-errors/
pages/gssp.js (6:3) @ getServerSideProps
"source": "pages/gssp.js (6:3) @ getServerSideProps
> 6 | missingVar;return {
| ^",
"stack": [
"getServerSideProps ../../test/integration/server-side-dev-errors/pages/gssp.js (6:3)",
"async doRender src/server/route-modules/pages/pages-handler.ts (244:22)",
"async handleResponse src/server/route-modules/pages/pages-handler.ts (539:24)",
"async Module.handler src/server/route-modules/pages/pages-handler.ts (760:9)",
"getServerSideProps pages/gssp.js (6:3)",
],
}
`
)
...
...
@@ -194,14 +188,11 @@ describe('server-side dev errors', () => {
"description": "missingVar is not defined",
"environmentLabel": null,
"label": "Runtime ReferenceError",
"source": "
../../test/integration/server-side-dev-errors/
pages/blog/[slug].js (6:3) @ getServerSideProps
"source": "pages/blog/[slug].js (6:3) @ getServerSideProps
> 6 | missingVar;return {
| ^",
"stack": [
"getServerSideProps ../../test/integration/server-side-dev-errors/pages/blog/[slug].js (6:3)",
"async doRender src/server/route-modules/pages/pages-handler.ts (244:22)",
"async handleResponse src/server/route-modules/pages/pages-handler.ts (539:24)",
"async Module.handler src/server/route-modules/pages/pages-handler.ts (760:9)",
"getServerSideProps pages/blog/[slug].js (6:3)",
],
}
`
)
...
...
@@ -257,12 +248,11 @@ describe('server-side dev errors', () => {
"description": "missingVar is not defined",
"environmentLabel": null,
"label": "Runtime ReferenceError",
"source": "
../../test/integration/server-side-dev-errors/
pages/api/hello.js (2:3) @ handler
"source": "pages/api/hello.js (2:3) @ handler
> 2 | missingVar;res.status(200).json({ hello: 'world' })
| ^",
"stack": [
"handler ../../test/integration/server-side-dev-errors/pages/api/hello.js (2:3)",
"async Module.handler src/build/templates/pages-api.ts (157:7)",
"handler pages/api/hello.js (2:3)",
],
}
`
)
...
...
@@ -324,12 +314,11 @@ describe('server-side dev errors', () => {
"description": "missingVar is not defined",
"environmentLabel": null,
"label": "Runtime ReferenceError",
"source": "
../../test/integration/server-side-dev-errors/
pages/api/blog/[slug].js (2:3) @ handler
"source": "pages/api/blog/[slug].js (2:3) @ handler
> 2 | missingVar;res.status(200).json({ slug: req.query.slug })
| ^",
"stack": [
"handler ../../test/integration/server-side-dev-errors/pages/api/blog/[slug].js (2:3)",
"async Module.handler src/build/templates/pages-api.ts (157:7)",
"handler pages/api/blog/[slug].js (2:3)",
],
}
`
)
...
...
test/production/app-dir/build-output-prerender/build-output-prerender.test.ts
View file @
6aa0ee81
...
...
@@ -34,7 +34,9 @@ describe('build-output-prerender', () => {
if
(
isTurbopack
)
{
expect
(
getPreambleOutput
(
next
.
cliOutput
)).
toMatchInlineSnapshot
(
`
"▲ Next.js x.y.z (Turbopack)
- Cache Components enabled"
- Cache Components enabled
- Experiments (use with caution):
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)"
`
)
}
else
if
(
isRspack
)
{
expect
(
getPreambleOutput
(
next
.
cliOutput
)).
toMatchInlineSnapshot
(
`
...
...
@@ -125,6 +127,7 @@ describe('build-output-prerender', () => {
- Experiments (use with caution):
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`)
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)
⨯ turbopackMinify (disabled by \`--debug-prerender\`)"
`
)
}
else
if
(
isRspack
)
{
...
...
@@ -239,9 +242,11 @@ describe('build-output-prerender', () => {
}
}
else
{
if
(
isTurbopack
)
{
expect
(
getPreambleOutput
(
next
.
cliOutput
)).
toMatchInlineSnapshot
(
`"▲ Next.js x.y.z (Turbopack)"`
)
expect
(
getPreambleOutput
(
next
.
cliOutput
)).
toMatchInlineSnapshot
(
`
"▲ Next.js x.y.z (Turbopack)
- Experiments (use with caution):
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)"
`
)
}
else
if
(
isRspack
)
{
expect
(
getPreambleOutput
(
next
.
cliOutput
)).
toMatchInlineSnapshot
(
`"▲ Next.js x.y.z (Rspack)"`
...
...
@@ -298,6 +303,7 @@ describe('build-output-prerender', () => {
- Experiments (use with caution):
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`)
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)
⨯ turbopackMinify (disabled by \`--debug-prerender\`)"
`
)
}
else
if
(
isRspack
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment