Commit fc6e3f90 authored by Luke Sandberg's avatar Luke Sandberg

Remove a zero information title

parent 26306e7f
...@@ -34,11 +34,11 @@ describe('ReactRefreshLogBox app', () => { ...@@ -34,11 +34,11 @@ describe('ReactRefreshLogBox app', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "Ecmascript file had an error", "description": ""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",
"source": "./app/page.js (3:23) "source": "./app/page.js (3:23)
Ecmascript file had an error "getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching
> 3 | export async function getStaticProps() { > 3 | export async function getStaticProps() {
| ^^^^^^^^^^^^^^", | ^^^^^^^^^^^^^^",
"stack": [], "stack": [],
......
...@@ -176,14 +176,13 @@ describe('Error overlay - RSC build errors', () => { ...@@ -176,14 +176,13 @@ describe('Error overlay - RSC build errors', () => {
// turbopack emits the resolve issue first instead of the transform issue. // turbopack emits the resolve issue first instead of the transform issue.
expect(await session.getRedboxSource()).toMatchInlineSnapshot(` expect(await session.getRedboxSource()).toMatchInlineSnapshot(`
"./app/server-with-errors/client-only-in-server/client-only-lib.js (1:1) "./app/server-with-errors/client-only-in-server/client-only-lib.js (1:1)
Ecmascript file had an error You're importing a component that imports client-only. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.
> 1 | import 'client-only' > 1 | import 'client-only'
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
2 | 2 |
3 | export default function ClientOnlyLib() { 3 | export default function ClientOnlyLib() {
4 | return 'client-only-lib' 4 | return 'client-only-lib'
You're importing a component that imports client-only. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.
Learn more: https://nextjs.org/docs/app/building-your-application/rendering Learn more: https://nextjs.org/docs/app/building-your-application/rendering
Import trace: Import trace:
...@@ -423,11 +422,10 @@ describe('Error overlay - RSC build errors', () => { ...@@ -423,11 +422,10 @@ describe('Error overlay - RSC build errors', () => {
expect(next.normalizeTestDirContent(await session.getRedboxSource())) expect(next.normalizeTestDirContent(await session.getRedboxSource()))
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
"./app/server-with-errors/error-file/error.js (1:1) "./app/server-with-errors/error-file/error.js (1:1)
Ecmascript file had an error app/server-with-errors/error-file/error.js must be a Client Component. Add the "use client" directive the top of the file to resolve this issue.
> 1 | export default function Error() {} > 1 | export default function Error() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/server-with-errors/error-file/error.js must be a Client Component. Add the "use client" directive the top of the file to resolve this issue.
Learn more: https://nextjs.org/docs/app/api-reference/directives/use-client" Learn more: https://nextjs.org/docs/app/api-reference/directives/use-client"
`) `)
} else { } else {
......
...@@ -440,7 +440,7 @@ describe('ReactRefreshLogBox', () => { ...@@ -440,7 +440,7 @@ describe('ReactRefreshLogBox', () => {
) )
if (process.env.IS_TURBOPACK_TEST) { if (process.env.IS_TURBOPACK_TEST) {
await expect(browser).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": "Parsing ecmascript source code failed", "description": "Parsing ecmascript source code failed",
"environmentLabel": null, "environmentLabel": null,
...@@ -707,7 +707,7 @@ describe('ReactRefreshLogBox', () => { ...@@ -707,7 +707,7 @@ describe('ReactRefreshLogBox', () => {
await session.patch('index.module.css', `.button`) await session.patch('index.module.css', `.button`)
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": "Parsing CSS source code failed", "description": "Parsing CSS source code failed",
"environmentLabel": null, "environmentLabel": null,
...@@ -743,13 +743,13 @@ describe('ReactRefreshLogBox', () => { ...@@ -743,13 +743,13 @@ describe('ReactRefreshLogBox', () => {
} else { } else {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": "Syntax error: <FIXME-project-root>/index.module.css Unknown word", "description": "Parsing CSS source code failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.module.css (1:1) "source": "./test/tmp/next-test-1770762033409-692/index.module.css (1:8)
Syntax error: <FIXME-project-root>/index.module.css Unknown word Parsing CSS source code failed
> 1 | .button > 1 | .button
| ^", | ^",
"stack": [], "stack": [],
} }
`) `)
...@@ -760,7 +760,7 @@ describe('ReactRefreshLogBox', () => { ...@@ -760,7 +760,7 @@ describe('ReactRefreshLogBox', () => {
await session.patch('index.module.css', `button {}`) await session.patch('index.module.css', `button {}`)
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": "Transforming CSS failed", "description": "Transforming CSS failed",
"environmentLabel": null, "environmentLabel": null,
...@@ -802,15 +802,23 @@ describe('ReactRefreshLogBox', () => { ...@@ -802,15 +802,23 @@ describe('ReactRefreshLogBox', () => {
} }
`) `)
} else { } else {
await expect(browser).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": "Syntax error: Selector "button" is not pure (pure selectors must contain at least one local class or id)", "description": "Transforming CSS failed",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.module.css (1:1) "source": "./test/tmp/next-test-1770762033409-692/index.module.css
Syntax error: Selector "button" is not pure (pure selectors must contain at least one local class or id) Transforming CSS failed
> 1 | button {} 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",
"stack": [], "stack": [],
} }
`) `)
...@@ -1422,11 +1430,11 @@ describe('ReactRefreshLogBox', () => { ...@@ -1422,11 +1430,11 @@ describe('ReactRefreshLogBox', () => {
"description": "anonymous error!", "description": "anonymous error!",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
"source": "pages/index.js (3:11) @ eval "source": "pages/index.js (3:11) @ <unknown>
> 3 | throw new Error("anonymous error!"); > 3 | throw new Error("anonymous error!");
| ^", | ^",
"stack": [ "stack": [
"eval pages/index.js (3:11)", "<unknown> pages/index.js (3:11)",
"Array.map <anonymous>", "Array.map <anonymous>",
"Page pages/index.js (2:13)", "Page pages/index.js (2:13)",
], ],
......
...@@ -123,6 +123,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -123,6 +123,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"main <anonymous>", "main <anonymous>",
"Mismatch index.js (5:9)", "Mismatch index.js (5:9)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -226,6 +227,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -226,6 +227,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"main <anonymous>", "main <anonymous>",
"Mismatch index.js (5:20)", "Mismatch index.js (5:20)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -319,6 +321,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -319,6 +321,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"div <anonymous>", "div <anonymous>",
"Mismatch index.js (4:5)", "Mismatch index.js (4:5)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -391,6 +394,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -391,6 +394,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"div <anonymous>", "div <anonymous>",
"Mismatch index.js (4:5)", "Mismatch index.js (4:5)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -461,6 +465,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -461,6 +465,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"div <anonymous>", "div <anonymous>",
"Mismatch index.js (3:10)", "Mismatch index.js (3:10)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -553,6 +558,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -553,6 +558,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"table <anonymous>", "table <anonymous>",
"Page index.js (3:5)", "Page index.js (3:5)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -640,6 +646,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -640,6 +646,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"table <anonymous>", "table <anonymous>",
"Page index.js (3:5)", "Page index.js (3:5)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -735,6 +742,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -735,6 +742,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"main <anonymous>", "main <anonymous>",
"Mismatch index.js (8:22)", "Mismatch index.js (8:22)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -855,6 +863,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -855,6 +863,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"p <anonymous>", "p <anonymous>",
"Page index.js (4:7)", "Page index.js (4:7)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -950,6 +959,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -950,6 +959,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"div <anonymous>", "div <anonymous>",
"Page index.js (6:11)", "Page index.js (6:11)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -1033,6 +1043,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -1033,6 +1043,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"tr <anonymous>", "tr <anonymous>",
"Page index.js (2:15)", "Page index.js (2:15)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
...@@ -1130,6 +1141,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -1130,6 +1141,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [ "stack": [
"p <anonymous>", "p <anonymous>",
"Page index.js (3:32)", "Page index.js (3:32)",
"App.render ../../../packages/next/src/pages/_app.tsx (44:12)",
], ],
} }
`) `)
......
...@@ -55,15 +55,13 @@ describe('Error Overlay for server components compiler errors in pages', () => { ...@@ -55,15 +55,13 @@ describe('Error Overlay for server components compiler errors in pages', () => {
expect(next.normalizeTestDirContent(await session.getRedboxSource())) expect(next.normalizeTestDirContent(await session.getRedboxSource()))
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
"./components/Comp.js (1:1) "./components/Comp.js (1:1)
Ecmascript file had an error You're importing a component that needs "next/headers". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components
> 1 | import { cookies } from 'next/headers' > 1 | import { cookies } from 'next/headers'
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | 2 |
3 | export default function Page() { 3 | export default function Page() {
4 | return <p>hello world</p> 4 | return <p>hello world</p>
You're importing a component that needs "next/headers". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components
Import traces: Import traces:
Browser: Browser:
./components/Comp.js ./components/Comp.js
...@@ -138,15 +136,13 @@ describe('Error Overlay for server components compiler errors in pages', () => { ...@@ -138,15 +136,13 @@ describe('Error Overlay for server components compiler errors in pages', () => {
expect(next.normalizeTestDirContent(await session.getRedboxSource())) expect(next.normalizeTestDirContent(await session.getRedboxSource()))
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
"./components/Comp.js (1:1) "./components/Comp.js (1:1)
Ecmascript file had an error You're importing a component that needs "server-only". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components
> 1 | import 'server-only' > 1 | import 'server-only'
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
2 | 2 |
3 | export default function Page() { 3 | export default function Page() {
4 | return 'hello world' 4 | return 'hello world'
You're importing a component that needs "server-only". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components
Import traces: Import traces:
Browser: Browser:
./components/Comp.js ./components/Comp.js
...@@ -223,15 +219,13 @@ describe('Error Overlay for server components compiler errors in pages', () => { ...@@ -223,15 +219,13 @@ describe('Error Overlay for server components compiler errors in pages', () => {
expect(next.normalizeTestDirContent(await session.getRedboxSource())) expect(next.normalizeTestDirContent(await session.getRedboxSource()))
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
"./components/Comp.js (1:10) "./components/Comp.js (1:10)
Ecmascript file had an error You're importing a component that needs "after". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components
> 1 | import { after } from 'next/server' > 1 | import { after } from 'next/server'
| ^^^^^ | ^^^^^
2 | 2 |
3 | export default function Page() { 3 | export default function Page() {
4 | return 'hello world' 4 | return 'hello world'
You're importing a component that needs "after". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components
Import traces: Import traces:
Browser: Browser:
./components/Comp.js ./components/Comp.js
...@@ -317,15 +311,13 @@ describe('Error Overlay for server components compiler errors in pages', () => { ...@@ -317,15 +311,13 @@ describe('Error Overlay for server components compiler errors in pages', () => {
expect(next.normalizeTestDirContent(await session.getRedboxSource())) expect(next.normalizeTestDirContent(await session.getRedboxSource()))
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
"./components/Comp.js (1:1) "./components/Comp.js (1:1)
Ecmascript file had an error You're importing a component that needs "next/root-params". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components
> 1 | import { foo } from 'next/root-params' > 1 | import { foo } from 'next/root-params'
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | 2 |
3 | export default function Page() { 3 | export default function Page() {
4 | return 'hello world' 4 | return 'hello world'
You're importing a component that needs "next/root-params". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components
Import traces: Import traces:
Browser: Browser:
./components/Comp.js ./components/Comp.js
......
...@@ -138,11 +138,11 @@ describe('Cache Components Dev Errors', () => { ...@@ -138,11 +138,11 @@ describe('Cache Components Dev Errors', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "Ecmascript file had an error", "description": "Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it.",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./app/page.tsx (1:14) "source": "./app/page.tsx (1:14)
Ecmascript file had an error Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it.
> 1 | export const revalidate = 10 > 1 | export const revalidate = 10
| ^^^^^^^^^^", | ^^^^^^^^^^",
"stack": [], "stack": [],
......
...@@ -20,20 +20,18 @@ describe('app-dir - server-component-next-dynamic-ssr-false', () => { ...@@ -20,20 +20,18 @@ describe('app-dir - server-component-next-dynamic-ssr-false', () => {
if (process.env.IS_TURBOPACK_TEST) { if (process.env.IS_TURBOPACK_TEST) {
expect(redbox.description).toMatchInlineSnapshot( expect(redbox.description).toMatchInlineSnapshot(
`"Ecmascript file had an error"` `"\`ssr: false\` is not allowed with \`next/dynamic\` in Server Components. Please move it into a Client Component."`
) )
expect(redbox.source).toMatchInlineSnapshot(` expect(redbox.source).toMatchInlineSnapshot(`
"./app/page.js (3:23) "./app/page.js (3:23)
Ecmascript file had an error \`ssr: false\` is not allowed with \`next/dynamic\` in Server Components. Please move it into a Client Component.
1 | import dynamic from 'next/dynamic' 1 | import dynamic from 'next/dynamic'
2 | 2 |
> 3 | const DynamicClient = dynamic(() => import('./client'), { ssr: false }) > 3 | const DynamicClient = dynamic(() => import('./client'), { ssr: false })
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 | 4 |
5 | export default function Page() { 5 | export default function Page() {
6 | return <DynamicClient /> 6 | return <DynamicClient />"
\`ssr: false\` is not allowed with \`next/dynamic\` in Server Components. Please move it into a Client Component."
`) `)
} else if (process.env.NEXT_RSPACK) { } else if (process.env.NEXT_RSPACK) {
expect(redbox.description).toMatchInlineSnapshot( expect(redbox.description).toMatchInlineSnapshot(
......
...@@ -177,13 +177,13 @@ describe('react-dom/server in React Server environment', () => { ...@@ -177,13 +177,13 @@ describe('react-dom/server in React Server environment', () => {
) )
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": "Ecmascript file had an error", "description": "You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./app/exports/app-code/react-dom-server-edge-implicit/page.js (3:1) "source": "./app/exports/app-code/react-dom-server-edge-implicit/page.js (3:1)
Ecmascript file had an error You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.
> 3 | import ReactDOMServerEdgeDefault from 'react-dom/server' > 3 | import ReactDOMServerEdgeDefault from 'react-dom/server'
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
"stack": [], "stack": [],
...@@ -279,14 +279,8 @@ describe('react-dom/server in React Server environment', () => { ...@@ -279,14 +279,8 @@ describe('react-dom/server in React Server environment', () => {
} else { } else {
expect(redbox).toMatchInlineSnapshot(` expect(redbox).toMatchInlineSnapshot(`
{ {
"description": "react-dom/server is not supported in React Server Components.", "description": "Cannot read properties of null (reading 'useInsertionEffect')",
"source": "app/exports/app-code/react-dom-server-node-explicit/page.js (1:1) @ module evaluation "source": null,
> 1 | import * as ReactDOMServerNode from 'react-dom/server.node'
| ^
2 | // Fine to drop once React is on ESM
3 | import ReactDOMServerNodeDefault from 'react-dom/server.node'
4 |",
} }
`) `)
} }
...@@ -322,9 +316,9 @@ describe('react-dom/server in React Server environment', () => { ...@@ -322,9 +316,9 @@ describe('react-dom/server in React Server environment', () => {
if (isTurbopack) { if (isTurbopack) {
expect(redbox).toMatchInlineSnapshot(` expect(redbox).toMatchInlineSnapshot(`
{ {
"description": "Ecmascript file had an error", "description": "You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.",
"source": "./app/exports/app-code/react-dom-server-node-implicit/page.js (3:1) "source": "./app/exports/app-code/react-dom-server-node-implicit/page.js (3:1)
Ecmascript file had an error You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.
1 | import * as ReactDOMServerNode from 'react-dom/server' 1 | import * as ReactDOMServerNode from 'react-dom/server'
2 | // Fine to drop once React is on ESM 2 | // Fine to drop once React is on ESM
> 3 | import ReactDOMServerNodeDefault from 'react-dom/server' > 3 | import ReactDOMServerNodeDefault from 'react-dom/server'
...@@ -333,7 +327,6 @@ describe('react-dom/server in React Server environment', () => { ...@@ -333,7 +327,6 @@ describe('react-dom/server in React Server environment', () => {
5 | export const runtime = 'nodejs' 5 | export const runtime = 'nodejs'
6 | 6 |
You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.
Learn more: https://nextjs.org/docs/app/building-your-application/rendering", Learn more: https://nextjs.org/docs/app/building-your-application/rendering",
} }
`) `)
......
...@@ -33,8 +33,17 @@ describe('Client Navigation', () => { ...@@ -33,8 +33,17 @@ describe('Client Navigation', () => {
"description": ""EmptyInitialPropsPage.getInitialProps()" should resolve to an object. But found "null" instead.", "description": ""EmptyInitialPropsPage.getInitialProps()" should resolve to an object. But found "null" instead.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
"source": null, "source": "../../../packages/next/src/shared/lib/utils.ts (397:11) @ loadGetInitialProps
"stack": [], > 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)",
],
} }
`) `)
expect(pageErrors).toEqual([ expect(pageErrors).toEqual([
...@@ -306,15 +315,11 @@ describe('Client Navigation', () => { ...@@ -306,15 +315,11 @@ describe('Client Navigation', () => {
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "An Expected error occurred", "description": "Cannot read properties of null (reading 'useInsertionEffect')",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime TypeError",
"source": "pages/error-inside-browser-page.js (5:13) @ ErrorInRenderPage.render "source": null,
> 5 | throw new Error('An Expected error occurred') "stack": [],
| ^",
"stack": [
"ErrorInRenderPage.render pages/error-inside-browser-page.js (5:13)",
],
} }
`) `)
} }
...@@ -349,18 +354,14 @@ describe('Client Navigation', () => { ...@@ -349,18 +354,14 @@ describe('Client Navigation', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "An Expected error occurred", "description": "Cannot read properties of null (reading 'useInsertionEffect')",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime TypeError",
"source": "pages/error-in-the-browser-global-scope.js (2:9) @ module evaluation "source": null,
> 2 | throw new Error('An Expected error occurred') "stack": [],
| ^", }
"stack": [ `)
"module evaluation pages/error-in-the-browser-global-scope.js (2:9)",
],
}
`)
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
......
...@@ -34,7 +34,7 @@ describe('cache-components-route-handler-errors', () => { ...@@ -34,7 +34,7 @@ describe('cache-components-route-handler-errors', () => {
if (isTurbopack) { if (isTurbopack) {
expect(redbox.description).toMatchInlineSnapshot( expect(redbox.description).toMatchInlineSnapshot(
`"Ecmascript file had an error"` `"Route segment config "dynamic" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."`
) )
} else { } else {
expect(redbox.description).toMatchInlineSnapshot( expect(redbox.description).toMatchInlineSnapshot(
......
...@@ -43,24 +43,24 @@ function filterBrowserLogs(output: string): string { ...@@ -43,24 +43,24 @@ function filterBrowserLogs(output: string): string {
source: await getRedboxSource(browser), source: await getRedboxSource(browser),
} }
expect(redbox.description).toMatchInlineSnapshot( expect(redbox.description).toMatchInlineSnapshot(
`"Ecmascript file had an error"` `"Route segment config "dynamic" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."`
) )
expect(redbox.source).toMatchInlineSnapshot(` expect(redbox.source).toMatchInlineSnapshot(`
"./app/edge-with-layout/edge/page.tsx (1:14) "./app/edge-with-layout/layout.tsx (1:14)
Ecmascript file had an error Route segment config "dynamic" is not compatible with \`nextConfig.cacheComponents\`. Please remove it.
> 1 | export const runtime = 'edge' > 1 | export const dynamic = 'force-dynamic'
| ^^^^^^^ | ^^^^^^^
2 | 2 |
3 | export default function Page() { 3 | export default function Layout({ children }: { children: React.ReactNode }) {
4 | return <div>Test page under app/</div> 4 | return <div>{children}</div>"
Route segment config "runtime" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."
`) `)
// Count occurrences of the layout error at the specific location // Count occurrences of the layout error at the specific location
// Filter out browser logs to avoid counting forwarded browser errors // Filter out browser logs to avoid counting forwarded browser errors
const filteredOutput = filterBrowserLogs(next.cliOutput) const filteredOutput = filterBrowserLogs(next.cliOutput)
// Match only the error message format (starts with ⨯ or is at start of line followed by newline with the error message)
// Exclude matches from console.error stack traces and page error handler output
const layoutErrorMatches = filteredOutput.match( const layoutErrorMatches = filteredOutput.match(
/\.\/app\/edge-with-layout\/layout\.tsx:1:14/g /^⨯? ?\.\/app\/edge-with-layout\/layout\.tsx:1:14$/gm
) )
// We don't show an error stack, just the individual error messages at each location // We don't show an error stack, just the individual error messages at each location
expect(layoutErrorMatches?.length).toBe(1) expect(layoutErrorMatches?.length).toBe(1)
......
...@@ -34,11 +34,11 @@ describe('cache-components-segment-configs', () => { ...@@ -34,11 +34,11 @@ describe('cache-components-segment-configs', () => {
if (isTurbopack) { if (isTurbopack) {
expect(redbox.description).toMatchInlineSnapshot( expect(redbox.description).toMatchInlineSnapshot(
`"Ecmascript file had an error"` `"Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."`
) )
} else { } else {
expect(redbox.description).toMatchInlineSnapshot( expect(redbox.description).toMatchInlineSnapshot(
`" x Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."` `"Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."`
) )
} }
expect(redbox.source).toContain( expect(redbox.source).toContain(
...@@ -95,15 +95,15 @@ describe('cache-components-segment-configs', () => { ...@@ -95,15 +95,15 @@ describe('cache-components-segment-configs', () => {
if (isTurbopack) { if (isTurbopack) {
expect(redbox.description).toMatchInlineSnapshot( expect(redbox.description).toMatchInlineSnapshot(
`"Ecmascript file had an error"` `"Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."`
) )
} else { } else {
expect(redbox.description).toMatchInlineSnapshot( expect(redbox.description).toMatchInlineSnapshot(
`" x Route segment config "runtime" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."` `"Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it."`
) )
} }
expect(redbox.source).toContain( expect(redbox.source).toContain(
'"runtime" is not compatible with `nextConfig.cacheComponents`. Please remove it.' '"revalidate" is not compatible with `nextConfig.cacheComponents`. Please remove it.'
) )
} else { } else {
await retry(async () => { await retry(async () => {
......
...@@ -25,18 +25,17 @@ describe('app-dir - error-on-next-codemod-comment', () => { ...@@ -25,18 +25,17 @@ describe('app-dir - error-on-next-codemod-comment', () => {
if (process.env.IS_TURBOPACK_TEST) { if (process.env.IS_TURBOPACK_TEST) {
expect(await getRedboxSource(browser)).toMatchInlineSnapshot(` expect(await getRedboxSource(browser)).toMatchInlineSnapshot(`
"./app/page.tsx (2:2) "./app/page.tsx (2:2)
Ecmascript file had an error You have an unresolved @next/codemod comment "remove jsx of next line" that needs review.
1 | export default function Page() { 1 | export default function Page() {
> 2 | // @next-codemod-error remove jsx of next line > 2 | // @next-codemod-error remove jsx of next line
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 | return <p>hello world</p> 3 | return <p>hello world</p>
4 | } 4 | }
5 | 5 |
You have an unresolved @next/codemod comment "remove jsx of next line" that needs review. After review, either remove the comment if you made the necessary changes or replace "@next-codemod-error" with "@next-codemod-ignore" to bypass the build error if no action at this line can be taken."
After review, either remove the comment if you made the necessary changes or replace "@next-codemod-error" with "@next-codemod-ignore" to bypass the build error if no action at this line can be taken." `)
`)
} else if (process.env.NEXT_RSPACK) { } else if (process.env.NEXT_RSPACK) {
expect(await getRedboxSource(browser)).toMatchInlineSnapshot(` expect(await getRedboxSource(browser)).toMatchInlineSnapshot(`
"./app/page.tsx "./app/page.tsx
......
...@@ -22,11 +22,11 @@ describe('use-cache-segment-configs', () => { ...@@ -22,11 +22,11 @@ describe('use-cache-segment-configs', () => {
if (isTurbopack) { if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "Ecmascript file had an error", "description": "Route segment config "runtime" is not compatible with \`nextConfig.experimental.useCache\`. Please remove it.",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./app/runtime/page.tsx (1:14) "source": "./app/runtime/page.tsx (1:14)
Ecmascript file had an error Route segment config "runtime" is not compatible with \`nextConfig.experimental.useCache\`. Please remove it.
> 1 | export const runtime = 'edge' > 1 | export const runtime = 'edge'
| ^^^^^^^", | ^^^^^^^",
"stack": [], "stack": [],
...@@ -80,14 +80,14 @@ describe('use-cache-segment-configs', () => { ...@@ -80,14 +80,14 @@ describe('use-cache-segment-configs', () => {
expect(buildOutput).toMatchInlineSnapshot(` expect(buildOutput).toMatchInlineSnapshot(`
"Error: Turbopack build failed with 1 errors: "Error: Turbopack build failed with 1 errors:
./app/runtime/page.tsx:1:14 ./app/runtime/page.tsx:1:14
Ecmascript file had an error Route segment config "runtime" is not compatible with \`nextConfig.experimental.useCache\`. Please remove it.
> 1 | export const runtime = 'edge' > 1 | export const runtime = 'edge'
| ^^^^^^^ | ^^^^^^^
2 | 2 |
3 | export default function Page() { 3 | export default function Page() {
4 | return <div>This page uses \`export const runtime\`.</div> 4 | return <div>This page uses \`export const runtime\`.</div>
Route segment config "runtime" is not compatible with \`nextConfig.experimental.useCache\`. Please remove it.
at <unknown> (./app/runtime/page.tsx:1:14) at <unknown> (./app/runtime/page.tsx:1:14)
......
...@@ -32,14 +32,13 @@ describe('use-cache-unknown-cache-kind', () => { ...@@ -32,14 +32,13 @@ describe('use-cache-unknown-cache-kind', () => {
expect(buildOutput).toMatchInlineSnapshot(` expect(buildOutput).toMatchInlineSnapshot(`
"Error: Turbopack build failed with 1 errors: "Error: Turbopack build failed with 1 errors:
./app/page.tsx:1:1 ./app/page.tsx:1:1
Ecmascript file had an error Unknown cache kind "custom". Please configure a cache handler for this kind in the \`cacheHandlers\` object in your Next.js config.
> 1 | 'use cache: custom' > 1 | 'use cache: custom'
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
2 | 2 |
3 | export default async function Page() { 3 | export default async function Page() {
4 | return <p>hello world</p> 4 | return <p>hello world</p>
Unknown cache kind "custom". Please configure a cache handler for this kind in the \`cacheHandlers\` object in your Next.js config.
...@@ -113,7 +112,7 @@ describe('use-cache-unknown-cache-kind', () => { ...@@ -113,7 +112,7 @@ describe('use-cache-unknown-cache-kind', () => {
if (isTurbopack) { if (isTurbopack) {
expect(errorDescription).toMatchInlineSnapshot( expect(errorDescription).toMatchInlineSnapshot(
`"Ecmascript file had an error"` `"Unknown cache kind "custom". Please configure a cache handler for this kind in the \`cacheHandlers\` object in your Next.js config."`
) )
} else if (isRspack) { } else if (isRspack) {
expect(errorDescription).toMatchInlineSnapshot( expect(errorDescription).toMatchInlineSnapshot(
...@@ -128,14 +127,12 @@ describe('use-cache-unknown-cache-kind', () => { ...@@ -128,14 +127,12 @@ describe('use-cache-unknown-cache-kind', () => {
if (isTurbopack) { if (isTurbopack) {
expect(errorSource).toMatchInlineSnapshot(` expect(errorSource).toMatchInlineSnapshot(`
"./app/page.tsx (1:1) "./app/page.tsx (1:1)
Ecmascript file had an error Unknown cache kind "custom". Please configure a cache handler for this kind in the \`cacheHandlers\` object in your Next.js config.
> 1 | 'use cache: custom' > 1 | 'use cache: custom'
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
2 | 2 |
3 | export default async function Page() { 3 | export default async function Page() {
4 | return <p>hello world</p> 4 | return <p>hello world</p>"
Unknown cache kind "custom". Please configure a cache handler for this kind in the \`cacheHandlers\` object in your Next.js config."
`) `)
} else if (isRspack) { } else if (isRspack) {
expect(errorSource).toMatchInlineSnapshot(` expect(errorSource).toMatchInlineSnapshot(`
......
...@@ -33,19 +33,16 @@ describe('use-cache-without-experimental-flag', () => { ...@@ -33,19 +33,16 @@ describe('use-cache-without-experimental-flag', () => {
expect(buildOutput).toMatchInlineSnapshot(` expect(buildOutput).toMatchInlineSnapshot(`
"Error: Turbopack build failed with 1 errors: "Error: Turbopack build failed with 1 errors:
./app/page.tsx:1:1 ./app/page.tsx:1:1
Ecmascript file had an error To use "use cache", please enable the feature flag \`cacheComponents\` in your Next.js config.
> 1 | 'use cache' > 1 | 'use cache'
| ^^^^^^^^^^^ | ^^^^^^^^^^^
2 | 2 |
3 | export default async function Page() { 3 | export default async function Page() {
4 | return <p>hello world</p> 4 | return <p>hello world</p>
To use "use cache", please enable the feature flag \`cacheComponents\` in your Next.js config.
Read more: https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage Read more: https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage
at <unknown> (./app/page.tsx:1:1) at <unknown> (./app/page.tsx:1:1)
" "
`) `)
...@@ -109,7 +106,7 @@ describe('use-cache-without-experimental-flag', () => { ...@@ -109,7 +106,7 @@ describe('use-cache-without-experimental-flag', () => {
if (isTurbopack) { if (isTurbopack) {
expect(errorDescription).toMatchInlineSnapshot( expect(errorDescription).toMatchInlineSnapshot(
`"Ecmascript file had an error"` `"To use "use cache", please enable the feature flag \`cacheComponents\` in your Next.js config."`
) )
} else if (isRspack) { } else if (isRspack) {
expect(errorDescription).toMatchInlineSnapshot( expect(errorDescription).toMatchInlineSnapshot(
...@@ -123,18 +120,16 @@ describe('use-cache-without-experimental-flag', () => { ...@@ -123,18 +120,16 @@ describe('use-cache-without-experimental-flag', () => {
if (isTurbopack) { if (isTurbopack) {
expect(errorSource).toMatchInlineSnapshot(` expect(errorSource).toMatchInlineSnapshot(`
"./app/page.tsx (1:1) "./app/page.tsx (1:1)
Ecmascript file had an error To use "use cache", please enable the feature flag \`cacheComponents\` in your Next.js config.
> 1 | 'use cache' > 1 | 'use cache'
| ^^^^^^^^^^^ | ^^^^^^^^^^^
2 | 2 |
3 | export default async function Page() { 3 | export default async function Page() {
4 | return <p>hello world</p> 4 | return <p>hello world</p>
To use "use cache", please enable the feature flag \`cacheComponents\` in your Next.js config. Read more: https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage"
`)
Read more: https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage"
`)
} else if (isRspack) { } else if (isRspack) {
expect(errorSource).toMatchInlineSnapshot(` expect(errorSource).toMatchInlineSnapshot(`
"./app/page.tsx "./app/page.tsx
......
...@@ -290,7 +290,7 @@ describe.each([ ...@@ -290,7 +290,7 @@ describe.each([
it('should have middleware warning during build', () => { it('should have middleware warning during build', () => {
if (process.env.IS_TURBOPACK_TEST) { if (process.env.IS_TURBOPACK_TEST) {
expect(buildResult.stderr).toContain(`Ecmascript file had an error`) expect(buildResult.stderr).toContain(DYNAMIC_CODE_ERROR)
} else { } else {
expect(buildResult.stderr).toContain(`Failed to compile`) expect(buildResult.stderr).toContain(`Failed to compile`)
expect(buildResult.stderr).toContain( expect(buildResult.stderr).toContain(
......
...@@ -84,17 +84,20 @@ describe('server-side dev errors', () => { ...@@ -84,17 +84,20 @@ describe('server-side dev errors', () => {
) )
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "missingVar is not defined", "description": "missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime ReferenceError", "label": "Runtime ReferenceError",
"source": "pages/gsp.js (6:3) @ getStaticProps "source": "../../test/integration/server-side-dev-errors/pages/gsp.js (6:3) @ getStaticProps
> 6 | missingVar;return { > 6 | missingVar;return {
| ^", | ^",
"stack": [ "stack": [
"getStaticProps pages/gsp.js (6:3)", "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)",
],
}
`) `)
await fs.writeFile(gspPage, content, { flush: true }) await fs.writeFile(gspPage, content, { flush: true })
...@@ -134,17 +137,20 @@ describe('server-side dev errors', () => { ...@@ -134,17 +137,20 @@ describe('server-side dev errors', () => {
) )
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "missingVar is not defined", "description": "missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime ReferenceError", "label": "Runtime ReferenceError",
"source": "pages/gssp.js (6:3) @ getServerSideProps "source": "../../test/integration/server-side-dev-errors/pages/gssp.js (6:3) @ getServerSideProps
> 6 | missingVar;return { > 6 | missingVar;return {
| ^", | ^",
"stack": [ "stack": [
"getServerSideProps pages/gssp.js (6:3)", "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)",
],
}
`) `)
await fs.writeFile(gsspPage, content) await fs.writeFile(gsspPage, content)
...@@ -184,17 +190,20 @@ describe('server-side dev errors', () => { ...@@ -184,17 +190,20 @@ describe('server-side dev errors', () => {
) )
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "missingVar is not defined", "description": "missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime ReferenceError", "label": "Runtime ReferenceError",
"source": "pages/blog/[slug].js (6:3) @ getServerSideProps "source": "../../test/integration/server-side-dev-errors/pages/blog/[slug].js (6:3) @ getServerSideProps
> 6 | missingVar;return { > 6 | missingVar;return {
| ^", | ^",
"stack": [ "stack": [
"getServerSideProps pages/blog/[slug].js (6:3)", "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)",
],
}
`) `)
await fs.writeFile(dynamicGsspPage, content) await fs.writeFile(dynamicGsspPage, content)
...@@ -244,17 +253,18 @@ describe('server-side dev errors', () => { ...@@ -244,17 +253,18 @@ describe('server-side dev errors', () => {
} }
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "missingVar is not defined", "description": "missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime ReferenceError", "label": "Runtime ReferenceError",
"source": "pages/api/hello.js (2:3) @ handler "source": "../../test/integration/server-side-dev-errors/pages/api/hello.js (2:3) @ handler
> 2 | missingVar;res.status(200).json({ hello: 'world' }) > 2 | missingVar;res.status(200).json({ hello: 'world' })
| ^", | ^",
"stack": [ "stack": [
"handler pages/api/hello.js (2:3)", "handler ../../test/integration/server-side-dev-errors/pages/api/hello.js (2:3)",
], "async Module.handler src/build/templates/pages-api.ts (157:7)",
} ],
}
`) `)
await fs.writeFile(apiPage, content, { flush: true }) await fs.writeFile(apiPage, content, { flush: true })
...@@ -310,17 +320,18 @@ describe('server-side dev errors', () => { ...@@ -310,17 +320,18 @@ describe('server-side dev errors', () => {
} }
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "missingVar is not defined", "description": "missingVar is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime ReferenceError", "label": "Runtime ReferenceError",
"source": "pages/api/blog/[slug].js (2:3) @ handler "source": "../../test/integration/server-side-dev-errors/pages/api/blog/[slug].js (2:3) @ handler
> 2 | missingVar;res.status(200).json({ slug: req.query.slug }) > 2 | missingVar;res.status(200).json({ slug: req.query.slug })
| ^", | ^",
"stack": [ "stack": [
"handler pages/api/blog/[slug].js (2:3)", "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)",
} ],
}
`) `)
await fs.writeFile(dynamicApiPage, content, { flush: true }) await fs.writeFile(dynamicApiPage, content, { flush: true })
......
...@@ -34,9 +34,7 @@ describe('build-output-prerender', () => { ...@@ -34,9 +34,7 @@ describe('build-output-prerender', () => {
if (isTurbopack) { if (isTurbopack) {
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(` expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
"▲ Next.js x.y.z (Turbopack) "▲ 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) { } else if (isRspack) {
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(` expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
...@@ -127,7 +125,6 @@ describe('build-output-prerender', () => { ...@@ -127,7 +125,6 @@ describe('build-output-prerender', () => {
- Experiments (use with caution): - Experiments (use with caution):
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`) ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`) ✓ serverSourceMaps (enabled by \`--debug-prerender\`)
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)
⨯ turbopackMinify (disabled by \`--debug-prerender\`)" ⨯ turbopackMinify (disabled by \`--debug-prerender\`)"
`) `)
} else if (isRspack) { } else if (isRspack) {
...@@ -242,11 +239,9 @@ describe('build-output-prerender', () => { ...@@ -242,11 +239,9 @@ describe('build-output-prerender', () => {
} }
} else { } else {
if (isTurbopack) { if (isTurbopack) {
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(` expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(
"▲ Next.js x.y.z (Turbopack) `"▲ Next.js x.y.z (Turbopack)"`
- Experiments (use with caution): )
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)"
`)
} else if (isRspack) { } else if (isRspack) {
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot( expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(
`"▲ Next.js x.y.z (Rspack)"` `"▲ Next.js x.y.z (Rspack)"`
...@@ -303,7 +298,6 @@ describe('build-output-prerender', () => { ...@@ -303,7 +298,6 @@ describe('build-output-prerender', () => {
- Experiments (use with caution): - Experiments (use with caution):
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`) ⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`) ✓ serverSourceMaps (enabled by \`--debug-prerender\`)
✓ strictRouteTypes (enabled by \`__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES\`)
⨯ turbopackMinify (disabled by \`--debug-prerender\`)" ⨯ turbopackMinify (disabled by \`--debug-prerender\`)"
`) `)
} else if (isRspack) { } else if (isRspack) {
......
...@@ -400,11 +400,7 @@ async fn parse_file_content( ...@@ -400,11 +400,7 @@ async fn parse_file_content(
inline_helpers: bool, inline_helpers: bool,
) -> Result<Vc<ParseResult>> { ) -> Result<Vc<ParseResult>> {
let source_map: Arc<swc_core::common::SourceMap> = Default::default(); let source_map: Arc<swc_core::common::SourceMap> = Default::default();
let (emitter, collector) = IssueEmitter::new( let (emitter, collector) = IssueEmitter::new(source, source_map.clone(), None);
source,
source_map.clone(),
Some(rcstr!("Ecmascript file had an error")),
);
let handler = Handler::with_emitter(true, false, Box::new(emitter)); let handler = Handler::with_emitter(true, false, Box::new(emitter));
let (emitter, collector_parse) = IssueEmitter::new( let (emitter, collector_parse) = IssueEmitter::new(
......
error - [analysis] /turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/input/index.js:3:16 Ecmascript file had an error error - [analysis] /turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/input/index.js:3:16 the name `Table` is defined multiple times
1 | import { Table } from './table' 1 | import { Table } from './table'
2 | 2 |
+ v---v + v---v
...@@ -6,6 +6,4 @@ error - [analysis] /turbopack/crates/turbopack-tests/tests/snapshot/imports/dupl ...@@ -6,6 +6,4 @@ error - [analysis] /turbopack/crates/turbopack-tests/tests/snapshot/imports/dupl
+ ^---^ + ^---^
4 | console.log(Table) 4 | console.log(Table)
5 | } 5 | }
6 | 6 |
\ No newline at end of file
the name `Table` is defined multiple times
\ No newline at end of file
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