Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Turbopack] add ./ to relative paths to make it easier to understand #73585

Draft
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

sokra
Copy link
Member

@sokra sokra commented Dec 6, 2024

No description provided.

Copy link
Member Author

sokra commented Dec 6, 2024

@sokra sokra changed the title add ./ to relative paths to make it easier to understand [Turbopack] add ./ to relative paths to make it easier to understand Dec 6, 2024
@ijjk
Copy link
Member

ijjk commented Dec 6, 2024

Failing test suites

Commit: 692085d

pnpm test-dev-turbo test/development/app-dir/owner-stack-react-missing-key-prop/react-missing-key-prop.test.ts (turbopack)

  • app-dir - react-missing-key-prop > should catch invalid element from on rsc component
  • app-dir - react-missing-key-prop > should catch invalid element from on ssr client component
Expand output

● app-dir - react-missing-key-prop › should catch invalid element from on rsc component

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - react-missing-key-prop should catch invalid element from on rsc component 1`

Snapshot: "at Page (app/rsc/page.tsx (5:6))"
Received: "at Page (./app/rsc/page.tsx (5:6))"

  62 |
  63 |       if (process.env.TURBOPACK) {
> 64 |         expect(stackFramesContent).toMatchInlineSnapshot(
     |                                    ^
  65 |           `"at Page (app/rsc/page.tsx (5:6))"`
  66 |         )
  67 |         expect(source).toMatchInlineSnapshot(`

  at Object.toMatchInlineSnapshot (development/app-dir/owner-stack-react-missing-key-prop/react-missing-key-prop.test.ts:64:36)

● app-dir - react-missing-key-prop › should catch invalid element from on rsc component

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - react-missing-key-prop should catch invalid element from on rsc component 2`

- Snapshot  - 1
+ Received  + 1

@@ -1,6 +1,6 @@
- app/rsc/page.tsx (5:6) @ Page
+ ./app/rsc/page.tsx (5:6) @ Page

    3 | export default function Page() {
    4 |   return (
  > 5 |     <div>
      |      ^

  65 |           `"at Page (app/rsc/page.tsx (5:6))"`
  66 |         )
> 67 |         expect(source).toMatchInlineSnapshot(`
     |                        ^
  68 |          "app/rsc/page.tsx (5:6) @ Page
  69 |
  70 |            3 | export default function Page() {

  at Object.toMatchInlineSnapshot (development/app-dir/owner-stack-react-missing-key-prop/react-missing-key-prop.test.ts:67:24)

● app-dir - react-missing-key-prop › should catch invalid element from on ssr client component

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - react-missing-key-prop should catch invalid element from on ssr client component 1`

Snapshot: "at Page (app/ssr/page.tsx (7:5))"
Received: "at Page (./app/ssr/page.tsx (7:5))"

  101 |       const source = await getRedboxSource(browser)
  102 |       if (process.env.TURBOPACK) {
> 103 |         expect(stackFramesContent).toMatchInlineSnapshot(
      |                                    ^
  104 |           `"at Page (app/ssr/page.tsx (7:5))"`
  105 |         )
  106 |         expect(source).toMatchInlineSnapshot(`

  at Object.toMatchInlineSnapshot (development/app-dir/owner-stack-react-missing-key-prop/react-missing-key-prop.test.ts:103:36)

● app-dir - react-missing-key-prop › should catch invalid element from on ssr client component

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - react-missing-key-prop should catch invalid element from on ssr client component 2`

- Snapshot  - 1
+ Received  + 1

@@ -1,6 +1,6 @@
- app/ssr/page.tsx (7:5) @ Page
+ ./app/ssr/page.tsx (7:5) @ Page

     5 | export default function Page() {
     6 |   return (
  >  7 |     <div>
       |     ^

  104 |           `"at Page (app/ssr/page.tsx (7:5))"`
  105 |         )
> 106 |         expect(source).toMatchInlineSnapshot(`
      |                        ^
  107 |                  "app/ssr/page.tsx (7:5) @ Page
  108 |
  109 |                     5 | export default function Page() {

  at Object.toMatchInlineSnapshot (development/app-dir/owner-stack-react-missing-key-prop/react-missing-key-prop.test.ts:106:24)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev-turbo test/development/app-dir/dynamic-error-trace/index.test.ts (turbopack)

  • app dir - dynamic error trace > should show the error trace
Expand output

● app dir - dynamic error trace › should show the error trace

expect(received).toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 1

@@ -1,6 +1,6 @@
- app/lib.js (4:13) @ Foo
+ ./app/lib.js (4:13) @ Foo

    2 |
    3 | export function Foo() {
  > 4 |   useHeaders()
      |             ^

  42 |
  43 |     const codeframe = await getRedboxSource(browser)
> 44 |     expect(codeframe).toEqual(
     |                       ^
  45 |       outdent`
  46 |             app/lib.js (4:13) @ Foo
  47 |

  at Object.toEqual (development/app-dir/dynamic-error-trace/index.test.ts:44:23)

● app dir - dynamic error trace › should show the error trace

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app dir - dynamic error trace should show the error trace 1`

- Snapshot  - 1
+ Received  + 1

  Foo
- app/lib.js
+ ./app/lib.js

  36 |     // TODO: Show useful stack
  37 |     const normalizedStack = normalizeStackTrace(stackFramesContent)
> 38 |     expect(normalizedStack).toMatchInlineSnapshot(`
     |                             ^
  39 |      "Foo
  40 |      app/lib.js"
  41 |     `)

  at Object.toMatchInlineSnapshot (development/app-dir/dynamic-error-trace/index.test.ts:38:29)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev-turbo test/development/app-dir/capture-console-error/capture-console-error.test.ts (turbopack)

  • app-dir - capture-console-error > should capture browser console error and format the error message
  • app-dir - capture-console-error > should capture browser console error in render and dedupe if necessary
  • app-dir - capture-console-error > should capture browser console error in render and dedupe when multi same errors logged
  • app-dir - capture-console-error > should capture server replay string error from console error
  • app-dir - capture-console-error > should capture server replay error instance from console error
  • app-dir - capture-console-error > should be able to capture rsc logged error
Expand output

● app-dir - capture-console-error › should capture browser console error and format the error message

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - capture-console-error should capture browser console error and format the error message 1`

- Snapshot  - 2
+ Received  + 2

@@ -1,11 +1,11 @@
  {
    "callStacks": "onClick
- app/browser/event/page.js (7:17)",
+ ./app/browser/event/page.js (7:17)",
    "count": 1,
    "description": "trigger an console <error>",
-   "source": "app/browser/event/page.js (7:17) @ onClick
+   "source": "./app/browser/event/page.js (7:17) @ onClick

     5 |     <button
     6 |       onClick={() => {
  >  7 |         console.error('trigger an console <%s>', 'error')
       |                 ^

  51 |
  52 |     if (process.env.TURBOPACK) {
> 53 |       expect(result).toMatchInlineSnapshot(`
     |                      ^
  54 |        {
  55 |          "callStacks": "onClick
  56 |        app/browser/event/page.js (7:17)",

  at Object.toMatchInlineSnapshot (development/app-dir/capture-console-error/capture-console-error.test.ts:53:22)

● app-dir - capture-console-error › should capture browser console error in render and dedupe if necessary

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - capture-console-error should capture browser console error in render and dedupe if necessary 1`

- Snapshot  - 2
+ Received  + 2

@@ -1,11 +1,11 @@
  {
    "callStacks": "Page
- app/browser/render/page.js (4:11)",
+ ./app/browser/render/page.js (4:11)",
    "count": 2,
    "description": "trigger an console.error in render",
-   "source": "app/browser/render/page.js (4:11) @ Page
+   "source": "./app/browser/render/page.js (4:11) @ Page

    2 |
    3 | export default function Page() {
  > 4 |   console.error('trigger an console.error in render')
      |           ^

   99 |
  100 |     if (process.env.TURBOPACK) {
> 101 |       expect(result).toMatchInlineSnapshot(`
      |                      ^
  102 |        {
  103 |          "callStacks": "Page
  104 |        app/browser/render/page.js (4:11)",

  at Object.toMatchInlineSnapshot (development/app-dir/capture-console-error/capture-console-error.test.ts:101:22)

● app-dir - capture-console-error › should capture browser console error in render and dedupe when multi same errors logged

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - capture-console-error should capture browser console error in render and dedupe when multi same errors logged 1`

- Snapshot  - 2
+ Received  + 2

@@ -1,11 +1,11 @@
  {
    "callStacks": "Page
- app/browser/render/page.js (4:11)",
+ ./app/browser/render/page.js (4:11)",
    "count": 2,
    "description": "trigger an console.error in render",
-   "source": "app/browser/render/page.js (4:11) @ Page
+   "source": "./app/browser/render/page.js (4:11) @ Page

    2 |
    3 | export default function Page() {
  > 4 |   console.error('trigger an console.error in render')
      |           ^

  147 |
  148 |     if (process.env.TURBOPACK) {
> 149 |       expect(result).toMatchInlineSnapshot(`
      |                      ^
  150 |        {
  151 |          "callStacks": "Page
  152 |        app/browser/render/page.js (4:11)",

  at Object.toMatchInlineSnapshot (development/app-dir/capture-console-error/capture-console-error.test.ts:149:22)

● app-dir - capture-console-error › should capture server replay string error from console error

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - capture-console-error should capture server replay string error from console error 1`

- Snapshot  - 2
+ Received  + 2

@@ -1,11 +1,11 @@
  {
    "callStacks": "Page
- app/ssr/page.js (4:11)",
+ ./app/ssr/page.js (4:11)",
    "count": 2,
    "description": "ssr console error:client",
-   "source": "app/ssr/page.js (4:11) @ Page
+   "source": "./app/ssr/page.js (4:11) @ Page

    2 |
    3 | export default function Page() {
  > 4 |   console.error(
      |           ^

  195 |
  196 |     if (process.env.TURBOPACK) {
> 197 |       expect(result).toMatchInlineSnapshot(`
      |                      ^
  198 |        {
  199 |          "callStacks": "Page
  200 |        app/ssr/page.js (4:11)",

  at Object.toMatchInlineSnapshot (development/app-dir/capture-console-error/capture-console-error.test.ts:197:22)

● app-dir - capture-console-error › should capture server replay error instance from console error

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - capture-console-error should capture server replay error instance from console error 1`

- Snapshot  - 2
+ Received  + 2

@@ -1,11 +1,11 @@
  {
    "callStacks": "Page
- app/ssr-error-instance/page.js (4:17)",
+ ./app/ssr-error-instance/page.js (4:17)",
    "count": 2,
    "description": "Error: page error",
-   "source": "app/ssr-error-instance/page.js (4:17) @ Page
+   "source": "./app/ssr-error-instance/page.js (4:17) @ Page

    2 |
    3 | export default function Page() {
  > 4 |   console.error(new Error('page error'))
      |                 ^

  243 |
  244 |     if (process.env.TURBOPACK) {
> 245 |       expect(result).toMatchInlineSnapshot(`
      |                      ^
  246 |        {
  247 |          "callStacks": "Page
  248 |        app/ssr-error-instance/page.js (4:17)",

  at Object.toMatchInlineSnapshot (development/app-dir/capture-console-error/capture-console-error.test.ts:245:22)

● app-dir - capture-console-error › should be able to capture rsc logged error

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - capture-console-error should be able to capture rsc logged error 1`

- Snapshot  - 2
+ Received  + 2

@@ -1,13 +1,13 @@
  {
    "callStacks": "Page
- app/rsc/page.js (2:17)
+ ./app/rsc/page.js (2:17)
  JSON.parse
  <anonymous> (0:0)",
    "count": 1,
    "description": "[ Server ] Error: boom",
-   "source": "app/rsc/page.js (2:17) @ Page
+   "source": "./app/rsc/page.js (2:17) @ Page

    1 | export default function Page() {
  > 2 |   console.error(new Error('boom'))
      |                 ^
    3 |   return <p>rsc</p>

  291 |
  292 |     if (process.env.TURBOPACK) {
> 293 |       expect(result).toMatchInlineSnapshot(`
      |                      ^
  294 |        {
  295 |          "callStacks": "Page
  296 |        app/rsc/page.js (2:17)

  at Object.toMatchInlineSnapshot (development/app-dir/capture-console-error/capture-console-error.test.ts:293:22)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev-turbo test/development/app-dir/server-navigation-error/server-navigation-error.test.ts (turbopack)

  • server-navigation-error > middleware > should error on navigation API redirect
  • server-navigation-error > middleware > should error on navigation API not-found
  • server-navigation-error > pages router > should error on navigation API redirect
  • server-navigation-error > pages router > should error on navigation API notFound
Expand output

● server-navigation-error › pages router › should error on navigation API redirect

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `server-navigation-error pages router should error on navigation API redirect 1`

- Snapshot  - 1
+ Received  + 1

@@ -1,6 +1,6 @@
- pages/pages/redirect.tsx (4:10) @ Page
+ ./pages/pages/redirect.tsx (4:10) @ Page

    2 |
    3 | export default function Page() {
  > 4 |   redirect('/')
      |          ^

  20 |       const source = await getRedboxSource(browser)
  21 |       if (process.env.TURBOPACK) {
> 22 |         expect(source).toMatchInlineSnapshot(`
     |                        ^
  23 |           "pages/pages/redirect.tsx (4:10) @ Page
  24 |
  25 |             2 |

  at Object.toMatchInlineSnapshot (development/app-dir/server-navigation-error/server-navigation-error.test.ts:22:24)

● server-navigation-error › pages router › should error on navigation API notFound

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `server-navigation-error pages router should error on navigation API notFound 1`

- Snapshot  - 1
+ Received  + 1

@@ -1,6 +1,6 @@
- pages/pages/not-found.tsx (4:10) @ Page
+ ./pages/pages/not-found.tsx (4:10) @ Page

    2 |
    3 | export default function Page() {
  > 4 |   notFound()
      |          ^

  52 |       const source = await getRedboxSource(browser)
  53 |       if (process.env.TURBOPACK) {
> 54 |         expect(source).toMatchInlineSnapshot(`
     |                        ^
  55 |           "pages/pages/not-found.tsx (4:10) @ Page
  56 |
  57 |             2 |

  at Object.toMatchInlineSnapshot (development/app-dir/server-navigation-error/server-navigation-error.test.ts:54:24)

● server-navigation-error › middleware › should error on navigation API redirect

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `server-navigation-error middleware should error on navigation API redirect  1`

- Snapshot  - 1
+ Received  + 1

@@ -1,6 +1,6 @@
- middleware.ts (8:12) @ middleware
+ ./middleware.ts (8:12) @ middleware

     6 |     notFound()
     7 |   } else if (req.nextUrl.pathname === '/middleware/redirect') {
  >  8 |     redirect('/')
       |            ^

  88 |       const source = await getRedboxSource(browser)
  89 |       if (process.env.TURBOPACK) {
> 90 |         expect(source).toMatchInlineSnapshot(`
     |                        ^
  91 |           "middleware.ts (8:12) @ middleware
  92 |
  93 |              6 |     notFound()

  at Object.toMatchInlineSnapshot (development/app-dir/server-navigation-error/server-navigation-error.test.ts:90:24)

● server-navigation-error › middleware › should error on navigation API not-found

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `server-navigation-error middleware should error on navigation API not-found 1`

- Snapshot  - 1
+ Received  + 1

@@ -1,6 +1,6 @@
- middleware.ts (6:12) @ middleware
+ ./middleware.ts (6:12) @ middleware

    4 | export default function middleware(req: NextRequest) {
    5 |   if (req.nextUrl.pathname === '/middleware/not-found') {
  > 6 |     notFound()
      |            ^

  123 |
  124 |       if (process.env.TURBOPACK) {
> 125 |         expect(source).toMatchInlineSnapshot(`
      |                        ^
  126 |           "middleware.ts (6:12) @ middleware
  127 |
  128 |             4 | export default function middleware(req: NextRequest) {

  at Object.toMatchInlineSnapshot (development/app-dir/server-navigation-error/server-navigation-error.test.ts:125:24)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev-turbo test/development/app-dir/hook-function-names/hook-function-names.test.ts (turbopack)

  • hook-function-names > should show readable hook names in stacks
  • hook-function-names > should show readable hook names in stacks for default-exported components
Expand output

● hook-function-names › should show readable hook names in stacks

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `hook-function-names should show readable hook names in stacks 1`

- Snapshot  - 1
+ Received  + 1

@@ -1,6 +1,6 @@
- app/button/page.tsx (7:11) @ Button.useCallback[handleClick]
+ ./app/button/page.tsx (7:11) @ Button.useCallback[handleClick]

     5 | const Button = ({ message }: { message: string }) => {
     6 |   const handleClick = useCallback(() => {
  >  7 |     throw new Error(message)
       |           ^

  15 |
  16 |     if (isTurbopack) {
> 17 |       expect(await getRedboxSource(browser)).toMatchInlineSnapshot(`
     |                                              ^
  18 |         "app/button/page.tsx (7:11) @ Button.useCallback[handleClick]
  19 |
  20 |            5 | const Button = ({ message }: { message: string }) => {

  at Object.toMatchInlineSnapshot (development/app-dir/hook-function-names/hook-function-names.test.ts:17:46)

● hook-function-names › should show readable hook names in stacks for default-exported components

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `hook-function-names should show readable hook names in stacks for default-exported components 1`

- Snapshot  - 1
+ Received  + 1

@@ -1,6 +1,6 @@
- app/page.tsx (7:11) @ Page.useEffect
+ ./app/page.tsx (7:11) @ Page.useEffect

     5 | export default function Page() {
     6 |   useEffect(() => {
  >  7 |     throw new Error('error in useEffect')
       |           ^

  47 |
  48 |     if (isTurbopack) {
> 49 |       expect(await getRedboxSource(browser)).toMatchInlineSnapshot(`
     |                                              ^
  50 |         "app/page.tsx (7:11) @ Page.useEffect
  51 |
  52 |            5 | export default function Page() {

  at Object.toMatchInlineSnapshot (development/app-dir/hook-function-names/hook-function-names.test.ts:49:46)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/e2e/app-dir/non-root-project-monorepo/non-root-project-monorepo.test.ts

  • non-root-project-monorepo > source-maps > should work on RSC
Expand output

● non-root-project-monorepo › source-maps › should work on RSC

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `non-root-project-monorepo source-maps should work on RSC 2`

- Snapshot  - 1
+ Received  + 1

  <unknown>
  [project]/apps/web/app/separate-file.ts [app-rsc] (ecmascript) (rsc://React/Server/file://<full-path>/apps/web/.next/server/chunks/ssr/apps_web_XXXXXX._.js (7:7)
  innerArrowFunction
- app/source-maps-rsc/page.tsx (13:28)
+ ./app/source-maps-rsc/page.tsx (13:28)
  innerFunction
  ./app/source-maps-rsc/page.tsx (10:3)
  Page
  ./app/source-maps-rsc/page.tsx (4:5)

  115 |               '/apps_web_XXXXXX._.js '
  116 |             )
> 117 |           ).toMatchInlineSnapshot(`
      |             ^
  118 |            "<unknown>
  119 |            [project]/apps/web/app/separate-file.ts [app-rsc] (ecmascript) (rsc://React/Server/file://<full-path>/apps/web/.next/server/chunks/ssr/apps_web_XXXXXX._.js (7:7)
  120 |            innerArrowFunction

  at Object.toMatchInlineSnapshot (e2e/app-dir/non-root-project-monorepo/non-root-project-monorepo.test.ts:117:13)

Read more about building and testing Next.js in contributing.md.

__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/development/app-dir/error-overlay/async-client-component/async-client-component.test.ts (PPR)

  • app-dir - async-client-component > app router client component async module
Expand output

● app-dir - async-client-component › app router client component async module

No Redbox to open.

  23 |     const browser = await next.browser('/client')
  24 |
> 25 |     await openRedbox(browser)
     |     ^
  26 |
  27 |     const description = await getRedboxDescription(browser)
  28 |     const componentStack = await getStackFramesContent(browser)

  at Object.<anonymous> (development/app-dir/error-overlay/async-client-component/async-client-component.test.ts:25:5)

Cause:
elementHandle.click: Element is not attached to the DOM
Call log:
  - attempting click action
  -   waiting for element to be visible, enabled and stable

  394 |   click() {
  395 |     return this.chain((el: ElementHandleExt) => {
> 396 |       return el.click().then(() => el)
      |                 ^
  397 |     })
  398 |   }
  399 |

  at click (lib/browsers/playwright.ts:396:17)
  at openRedbox (lib/next-test-utils.ts:913:7)
  at Object.<anonymous> (development/app-dir/error-overlay/async-client-component/async-client-component.test.ts:25:5)
  at Proxy.chain (lib/browsers/base.ts:17:23)
  at Proxy.chain (lib/browsers/playwright.ts:395:17)
  at click (lib/next-test-utils.ts:913:63)
  at Object.<anonymous> (development/app-dir/error-overlay/async-client-component/async-client-component.test.ts:25:5)

Read more about building and testing Next.js in contributing.md.

__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/e2e/app-dir/server-source-maps/server-source-maps.test.ts (PPR)

  • app-dir - server source maps > logged errors have a sourcemapped stack with a codeframe
  • app-dir - server source maps > logged errors have a sourcemapped cause
  • app-dir - server source maps > stack frames are ignore-listed in ssr
  • app-dir - server source maps > stack frames are ignore-listed in rsc
  • app-dir - server source maps > thrown SSR errors
Expand output

● app-dir - server source maps › logged errors have a sourcemapped stack with a codeframe

expect(received).toContain(expected) // indexOf

Expected substring: "
Error: Boom

  at logError (../app/rsc-error-log/page.js:4:16)
  at Page (../app/rsc-error-log/page.js:11:2)
    2 |
    3 | function logError() {
  > 4 |   const error = new Error('Boom')
      |                ^
    5 |   console.error(error)
    6 | }
    7 |
  "
  Received string:    " ○ Compiling /rsc-error-log ...
   ✓ Compiled /rsc-error-log in 4.8s (739 modules)
  Error: Boom
  at logError (../app/rsc-error-log/page.js:4:16)
  at Page (../app/rsc-error-log/page.js:11:2)
    2 |
    3 | function logError() {
  > 4 |   const error = new Error('Boom')
      |                ^
    5 |   console.error(error)
    6 | }
    7 |
  "
  at Object.toContain (e2e/app-dir/server-source-maps/server-source-maps.test.ts:37:69)

● app-dir - server source maps › logged errors have a sourcemapped cause

expect(received).toContain(expected) // indexOf

Expected substring: "
Error: Boom

  at logError (../app/rsc-error-log-cause/page.js:4:16)
  at Page (../app/rsc-error-log-cause/page.js:12:2)
    2 |
    3 | function logError(cause) {
  > 4 |   const error = new Error('Boom', { cause })
      |                ^
    5 |   console.error(error)
    6 | }
    7 | {
    [cause]: Error: Boom
  at Page (../app/rsc-error-log-cause/page.js:11:16)
       9 |   await connection()
      10 |
    > 11 |   const error = new Error('Boom')
         |                ^
      12 |   logError(error)
      13 |   return null
      14 | }
  "
  Received string:    " GET /rsc-error-log 200 in 5240ms
   ○ Compiling /rsc-error-log-cause ...
   ✓ Compiled /rsc-error-log-cause in 1944ms (741 modules)
  Error: Boom
  at logError (../app/rsc-error-log-cause/page.js:4:16)
  at Page (../app/rsc-error-log-cause/page.js:12:2)
    2 |
    3 | function logError(cause) {
  > 4 |   const error = new Error('Boom', { cause })
      |                ^
    5 |   console.error(error)
    6 | }
    7 | {
    [cause]: Error: Boom
  at Page (../app/rsc-error-log-cause/page.js:11:16)
       9 |   await connection()
      10 |
    > 11 |   const error = new Error('Boom')
         |                ^
      12 |   logError(error)
      13 |   return null
      14 | }
  }
   GET /rsc-error-log-cause 200 in 2093ms
  "
  at Object.toContain (e2e/app-dir/server-source-maps/server-source-maps.test.ts:63:69)

● app-dir - server source maps › stack frames are ignore-listed in ssr

expect(received).toContain(expected) // indexOf

Expected substring: "
Error: Boom

  at logError (../app/ssr-error-log-ignore-listed/page.js:8:16)
  at runWithExternalSourceMapped (../app/ssr-error-log-ignore-listed/page.js:17:10)
  at runWithExternal (../app/ssr-error-log-ignore-listed/page.js:16:32)
  at runWithInternalSourceMapped (../app/ssr-error-log-ignore-listed/page.js:15:18)
  at runWithInternal (../app/ssr-error-log-ignore-listed/page.js:14:28)
  at Page (../app/ssr-error-log-ignore-listed/page.js:13:14)
     6 |
  "
  Received string:    " ✓ Compiled /ssr-error-log-ignore-listed in 366ms (757 modules)
  Error: Boom
  at logError (../app/ssr-error-log-ignore-listed/page.js:8:16)
  at runWithExternalSourceMapped (../app/ssr-error-log-ignore-listed/page.js:17:10)
  at runWithExternal (../app/ssr-error-log-ignore-listed/page.js:16:32)
  at runWithInternalSourceMapped (../app/ssr-error-log-ignore-listed/page.js:15:18)
  at runWithInternal (../app/ssr-error-log-ignore-listed/page.js:14:28)
  at Page (../app/ssr-error-log-ignore-listed/page.js:13:14)
     6 |
     7 | function logError() {
  >  8 |   const error = new Error('Boom')
       |                ^
     9 |   console.error(error)
    10 | }
    11 |
  Error: Boom
  at logError (../app/ssr-error-log-ignore-listed/page.js:8:16)
  at runWithExternalSourceMapped (../app/ssr-error-log-ignore-listed/page.js:17:10)
  at runWithExternal (../app/ssr-error-log-ignore-listed/page.js:16:32)
  at runWithInternalSourceMapped (../app/ssr-error-log-ignore-listed/page.js:15:18)
  at runWithInternal (../app/ssr-error-log-ignore-listed/page.js:14:28)
  at Page (../app/ssr-error-log-ignore-listed/page.js:13:14)
     6 |
     7 | function logError() {
  >  8 |   const error = new Error('Boom')
       |                ^
     9 |   console.error(error)
    10 | }
    11 |
  "
  at Object.toContain (e2e/app-dir/server-source-maps/server-source-maps.test.ts:104:71)

● app-dir - server source maps › stack frames are ignore-listed in rsc

expect(received).toContain(expected) // indexOf

Expected substring: "
Error: Boom

  at logError (../app/rsc-error-log-ignore-listed/page.js:8:16)
  at runWithExternalSourceMapped (../app/rsc-error-log-ignore-listed/page.js:19:10)
  at runWithExternal (../app/rsc-error-log-ignore-listed/page.js:18:32)
  at runWithInternalSourceMapped (../app/rsc-error-log-ignore-listed/page.js:17:18)
  at runWithInternal (../app/rsc-error-log-ignore-listed/page.js:16:28)
  at Page (../app/rsc-error-log-ignore-listed/page.js:15:14)
     6 |
  "
  Received string:    " GET /ssr-error-log-ignore-listed 200 in 488ms
   ✓ Compiled /rsc-error-log-ignore-listed in 351ms (761 modules)
  Error: Boom
  at logError (../app/rsc-error-log-ignore-listed/page.js:8:16)
  at runWithExternalSourceMapped (../app/rsc-error-log-ignore-listed/page.js:19:10)
  at runWithExternal (../app/rsc-error-log-ignore-listed/page.js:18:32)
  at runWithInternalSourceMapped (../app/rsc-error-log-ignore-listed/page.js:17:18)
  at runWithInternal (../app/rsc-error-log-ignore-listed/page.js:16:28)
  at Page (../app/rsc-error-log-ignore-listed/page.js:15:14)
     6 |
     7 | function logError() {
  >  8 |   const error = new Error('Boom')
       |                ^
     9 |   console.error(error)
    10 | }
    11 |
   GET /rsc-error-log-ignore-listed 200 in 457ms
  "
  at Object.toContain (e2e/app-dir/server-source-maps/server-source-maps.test.ts:138:71)

● app-dir - server source maps › thrown SSR errors

expect(received).toContain(expected) // indexOf

Expected substring: "
 ⨯ Error: Boom

  at throwError (../app/ssr-throw/Thrower.js:4:8)
  at Thrower (../app/ssr-throw/Thrower.js:8:2)
    2 |
    3 | function throwError() {
  > 4 |   throw new Error('Boom')
      |        ^
    5 | }
    6 |
    7 | export function Thrower() { {
    digest: '"
  Received string:    " ✓ Compiled /ssr-throw in 228ms (769 modules)
   ⨯ Error: Boom
  at throwError (../app/ssr-throw/Thrower.js:4:8)
  at Thrower (../app/ssr-throw/Thrower.js:8:2)
    2 |
    3 | function throwError() {
  > 4 |   throw new Error('Boom')
      |        ^
    5 | }
    6 |
    7 | export function Thrower() { {
    digest: '4071276871'
  }
   GET /ssr-throw 200 in 376ms
  "
  at Object.toContain (e2e/app-dir/server-source-maps/server-source-maps.test.ts:168:25)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/e2e/app-dir/server-source-maps/server-source-maps-edge.test.ts

  • app-dir - server source maps edge runtime > logged errors have a sourcemapped stack with a codeframe
  • app-dir - server source maps edge runtime > thrown SSR errors
  • app-dir - server source maps edge runtime > should log the correct values on app-render error
Expand output

● app-dir - server source maps edge runtime › logged errors have a sourcemapped stack with a codeframe

expect(received).toContain(expected) // indexOf

Expected substring: "
Error: Boom

  at logError (../app/rsc-error-log/page.js:2:16)
  at Page (../app/rsc-error-log/page.js:6:2)
    1 | function logError() {
  > 2 |   console.error(new Error('Boom'))
      |                ^
    3 | }
    4 |
    5 | export default function Page() { {···
  }"
  Received string:    " ○ Compiling /rsc-error-log ...
   ✓ Compiled /rsc-error-log in 6s (1046 modules)
  Error: Boom
  at logError (../app/rsc-error-log/page.js:2:16)
  at Page (../app/rsc-error-log/page.js:6:2)
    1 | function logError() {
  > 2 |   console.error(new Error('Boom'))
      |                ^
    3 | }
    4 |
    5 | export default function Page() { {···
  }
  "
  at Object.toContain (e2e/app-dir/server-source-maps/server-source-maps-edge.test.ts:29:69)

● app-dir - server source maps edge runtime › thrown SSR errors

expect(received).toContain(expected) // indexOf

Expected substring: "
 ⨯ Error: Boom

  at throwError (../app/ssr-throw/page.js:4:8)
  at Page (../app/ssr-throw/page.js:8:2)
    2 |
    3 | function throwError() {
  > 4 |   throw new Error('Boom')
      |        ^
    5 | }
    6 |
    7 | export default function Page() { {
    digest: '"
  Received string:    " GET /rsc-error-log 200 in 6420ms
   ○ Compiling /ssr-throw ...
   ✓ Compiled /ssr-throw in 1684ms (1054 modules)
   ⨯ Error: Boom
  at throwError (../app/ssr-throw/page.js:4:8)
  at Page (../app/ssr-throw/page.js:8:2)
    2 |
    3 | function throwError() {
  > 4 |   throw new Error('Boom')
      |        ^
    5 | }
    6 |
    7 | export default function Page() { {
    digest: '1687900914'
  }
  "
  at Object.toContain (e2e/app-dir/server-source-maps/server-source-maps-edge.test.ts:57:25)

● app-dir - server source maps edge runtime › should log the correct values on app-render error

expect(received).toContain(expected) // indexOf

Expected substring: "
 ⨯ Error: Boom

  at throwError (../app/rsc-throw/page.js:2:8)
  at Page (../app/rsc-throw/page.js:6:2)
    1 | function throwError() {
  > 2 |   throw new Error('Boom')
      |        ^
    3 | }
    4 |
    5 | export default function Page() { {
    digest: '"
  Received string:    " GET /ssr-throw 500 in 2238ms
   ✓ Compiled /rsc-throw in 447ms (1057 modules)
   ⨯ Error: Boom
  at throwError (../app/rsc-throw/page.js:2:8)
  at Page (../app/rsc-throw/page.js:6:2)
    1 | function throwError() {
  > 2 |   throw new Error('Boom')
      |        ^
    3 | }
    4 |
    5 | export default function Page() { {
    digest: '2423238197'
  }
  "
  at Object.toContain (e2e/app-dir/server-source-maps/server-source-maps-edge.test.ts:86:25)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/e2e/app-dir/use-cache-close-over-function/use-cache-close-over-function.test.ts

  • use-cache-close-over-function > should show an error toast for client-side usage
  • use-cache-close-over-function > should show the error overlay for server-side usage
Expand output

● use-cache-close-over-function › should show an error toast for client-side usage

expect(received).toContain(expected) // indexOf

Expected substring: "Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
  [function fn]
   ^^^^^^^^^^^

  at createCachedFn (../app/client/page.tsx:8:2)
  at Page (../app/client/page.tsx:15:27)
     6 |   }
     7 |
  >  8 |   return async () => {
       |  ^
     9 |     'use cache'
    10 |     return Math.random() + fn()
    11 |   }"
  Received string:    " ○ Compiling /client ...
   ✓ Compiled /client in 4.8s (750 modules)
  Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/client/page.tsx:8:2)
  at Page (../app/client/page.tsx:15:27)
     6 |   }
     7 |
  >  8 |   return async () => {
       |  ^
     9 |     'use cache'
    10 |     return Math.random() + fn()
    11 |   }
   ⨯ Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/client/page.tsx:8:2)
  at Page (../app/client/page.tsx:15:27)
     6 |   }
     7 |
  >  8 |   return async () => {
       |  ^
     9 |     'use cache'
    10 |     return Math.random() + fn()
    11 |   } {
    digest: '4011772603'
  }
  Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/client/page.tsx:8:2)
  at Page (../app/client/page.tsx:15:27)
     6 |   }
     7 |
  >  8 |   return async () => {
       |  ^
     9 |     'use cache'
    10 |     return Math.random() + fn()
    11 |   }
  Failed to serialize an action for progressive enhancement:
  Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/client/page.tsx:8:2)
  at Page (../app/client/page.tsx:15:27)
     6 |   }
     7 |
  >  8 |   return async () => {
       |  ^
     9 |     'use cache'
    10 |     return Math.random() + fn()
    11 |   } {
    environmentName: 'Prerender',
    digest: '4011772603'
  }
  Failed to serialize an action for progressive enhancement:
  Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/client/page.tsx:8:2)
  at Page (../app/client/page.tsx:15:27)
     6 |   }
     7 |
  >  8 |   return async () => {
       |  ^
     9 |     'use cache'
    10 |     return Math.random() + fn()
    11 |   } {
    environmentName: 'Server',
    digest: ''
  }
  Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/client/page.tsx:8:2)
  at Page (../app/client/page.tsx:15:27)
     6 |   }
     7 |
  >  8 |   return async () => {
       |  ^
     9 |     'use cache'
    10 |     return Math.random() + fn()
    11 |   }
  Failed to serialize an action for progressive enhancement:
  Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/client/page.tsx:8:2)
  at Page (../app/client/page.tsx:15:27)
     6 |   }
     7 |
  >  8 |   return async () => {
       |  ^
     9 |     'use cache'
    10 |     return Math.random() + fn()
    11 |   } {
    environmentName: 'Server',
    digest: ''
  }
   GET /client 200 in 6932ms
  "
  at Object.toContain (e2e/app-dir/use-cache-close-over-function/use-cache-close-over-function.test.ts:50:25)

● use-cache-close-over-function › should show the error overlay for server-side usage

expect(received).toContain(expected) // indexOf

Expected substring: "Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
  [function fn]
   ^^^^^^^^^^^

  at createCachedFn (../app/server/page.tsx:6:2)
  at eval (../app/server/page.tsx:12:23)
      at (rsc)"
  Received string:    " ✓ Compiled /server in 372ms (753 modules)
  Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/server/page.tsx:6:2)
  at eval (../app/server/page.tsx:12:23)
  at (rsc)/./app/server/page.tsx (../.next/server/app/server/page.js:172:1)
  at Function.__webpack_require__ (../.next/server/webpack-runtime.js:33:42)
    4 |   }
    5 |
  > 6 |   return async () => {
      |  ^
    7 |     'use cache'
    8 |     return Math.random() + fn()
    9 |   }
  Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/server/page.tsx:6:2)
  at eval (../app/server/page.tsx:12:23)
  at (rsc)/./app/server/page.tsx (../.next/server/app/server/page.js:172:1)
  at Function.__webpack_require__ (../.next/server/webpack-runtime.js:33:42)
    4 |   }
    5 |
  > 6 |   return async () => {
      |  ^
    7 |     'use cache'
    8 |     return Math.random() + fn()
    9 |   }
   ⨯ unhandledRejection: Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/server/page.tsx:6:2)
  at eval (../app/server/page.tsx:12:23)
  at (rsc)/./app/server/page.tsx (../.next/server/app/server/page.js:172:1)
  at Function.__webpack_require__ (../.next/server/webpack-runtime.js:33:42)
    4 |   }
    5 |
  > 6 |   return async () => {
      |  ^
    7 |     'use cache'
    8 |     return Math.random() + fn()
    9 |   }
   ⨯ unhandledRejection:  Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/server/page.tsx:6:2)
  at eval (../app/server/page.tsx:12:23)
  at (rsc)/./app/server/page.tsx (../.next/server/app/server/page.js:172:1)
  at Function.__webpack_require__ (../.next/server/webpack-runtime.js:33:42)
    4 |   }
    5 |
  > 6 |   return async () => {
      |  ^
    7 |     'use cache'
    8 |     return Math.random() + fn()
    9 |   }
   ⨯ Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.
    [function fn]
     ^^^^^^^^^^^
  at createCachedFn (../app/server/page.tsx:6:2)
  at eval (../app/server/page.tsx:12:23)
  at (rsc)/./app/server/page.tsx (../.next/server/app/server/page.js:172:1)
  at Function.__webpack_require__ (../.next/server/webpack-runtime.js:33:42)
    4 |   }
    5 |
  > 6 |   return async () => {
      |  ^
    7 |     'use cache'
    8 |     return Math.random() + fn()
    9 |   } {
    digest: '1948342019'
  }
   GET /server 200 in 2285ms
  "
  at Object.toContain (e2e/app-dir/use-cache-close-over-function/use-cache-close-over-function.test.ts:108:25)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/development/middleware-errors/index.test.ts

  • middleware - development errors > when middleware contains an unhandled rejection > logs the error correctly
  • middleware - development errors > when middleware throws synchronously > logs the error correctly
  • middleware - development errors > when running invalid dynamic code with eval > logs the error correctly
  • middleware - development errors > when running invalid dynamic code with eval > renders the error correctly and recovers
  • middleware - development errors > when throwing while loading the module > logs the error correctly
Expand output

● middleware - development errors › when middleware throws synchronously › logs the error correctly

expect(received).toContain(expected) // indexOf

Expected substring: "
 ⨯ Error: boom

  at default (../middleware.js:3:14)
    1 |"
  Received string:    "   No config file found
     No config file found
     ▲ Next.js 15.2.0-canary.39
     - Local:        http://localhost:34699
     - Network:      http://144.76.200.208:34699·
   ✓ Starting...
     No config file found
     No config file found
   ✓ Ready in 1024ms
   ✓ Compiled /middleware in 286ms (79 modules)
   ⨯ Error: boom
  at default (../middleware.js:3:14)
    1 |
    2 |       export default function () {
  > 3 |         throw new Error('boom')
      |              ^
    4 |       }
   ○ Compiling /_error ...
   ✓ Compiled /_error in 1154ms (350 modules)
  "
  at Object.toContain (development/middleware-errors/index.test.ts:40:41)

● middleware - development errors › when middleware contains an unhandled rejection › logs the error correctly

expect(received).toContain(expected) // indexOf

Expected substring: "
 ⨯ unhandledRejection:  Error: async boom!

  at throwError (../middleware.js:4:14)
  at default (../middleware.js:7:8)
    2 |       import { NextResponse } from 'next/server'"
  Received string:    "   No config file found
     No config file found
     ▲ Next.js 15.2.0-canary.39
     - Local:        http://localhost:42515
     - Network:      http://144.76.200.208:42515·
   ✓ Starting...
     No config file found
     No config file found
   ✓ Ready in 1044ms
   ✓ Compiled /middleware in 223ms (99 modules)
  Error: async boom!
  at throwError (../middleware.js:4:14)
  at default (../middleware.js:7:8)
    2 |       import { NextResponse } from 'next/server'
    3 |       async function throwError() {
  > 4 |         throw new Error('async boom!')
      |              ^
    5 |       }
    6 |       export default function () {
    7 |         throwError()
   ⨯ unhandledRejection: Error: async boom!
  at throwError (../middleware.js:4:14)
  at default (../middleware.js:7:8)
    2 |       import { NextResponse } from 'next/server'
    3 |       async function throwError() {
  > 4 |         throw new Error('async boom!')
      |              ^
    5 |       }
    6 |       export default function () {
    7 |         throwError()
   ⨯ unhandledRejection:  Error: async boom!
  at throwError (../middleware.js:4:14)
  at default (../middleware.js:7:8)
    2 |       import { NextResponse } from 'next/server'
    3 |       async function throwError() {
  > 4 |         throw new Error('async boom!')
      |              ^
    5 |       }
    6 |       export default function () {
    7 |         throwError()
   ✓ Compiled / in 281ms (356 modules)
  "
  at Object.toContain (development/middleware-errors/index.test.ts:91:41)

● middleware - development errors › when running invalid dynamic code with eval › logs the error correctly

expect(received).toContain(expected) // indexOf

Expected substring: "
 ⨯ Error [ReferenceError]: test is not defined
    at eval (file://webpack-internal:///(middleware)/./middleware.js)

  at eval (../middleware.js:4:8)
  at default (../middleware.js:4:8)
    2 |       import { NextResponse } from 'next/server'"
  Received string:    "   No config file found
     No config file found
     ▲ Next.js 15.2.0-canary.39
     - Local:        http://localhost:40801
     - Network:      http://144.76.200.208:40801·
   ✓ Starting...
     No config file found
     No config file found
   ✓ Ready in 1078ms
   ✓ Compiled /middleware in 150ms (99 modules)
   ⚠ DynamicCodeEvaluationWarning: Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime
  Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation
  at default (../middleware.js:4:8)
    2 |       import { NextResponse } from 'next/server'
    3 |       export default function () {
  > 4 |         eval('test')
      |        ^
    5 |         return NextResponse.next()
    6 |       }
  [TypeError: Invalid URL] {
    code: 'ERR_INVALID_URL',
    input: 'file://webpack-internal:///(middleware)/./middleware.js'
  }
   ✓ Compiled /_error in 271ms (350 modules)
  "
  at Object.toContain (development/middleware-errors/index.test.ts:146:41)

● middleware - development errors › when running invalid dynamic code with eval › renders the error correctly and recovers

Expected Redbox but found none

  173 |     it('renders the error correctly and recovers', async () => {
  174 |       const browser = await next.browser('/')
> 175 |       await assertHasRedbox(browser)
      |       ^
  176 |
  177 |       const lengthOfLogs = next.cliOutput.length
  178 |

  at Object.<anonymous> (development/middleware-errors/index.test.ts:175:7)

● middleware - development errors › when throwing while loading the module › logs the error correctly

expect(received).toContain(expected) // indexOf

Expected substring: "
 ⨯ Error: booooom!
    at <unknown> (middleware.js:3)

  at eval (../middleware.js:3:12)
  at (middleware)/./middleware.js (../.next/server/middleware.js:40:1)
      at __webpack_require__ "
  Received string:    "   No config file found
     No config file found
     ▲ Next.js 15.2.0-canary.39
     - Local:        http://localhost:35093
     - Network:      http://144.76.200.208:35093·
   ✓ Starting...
     No config file found
     No config file found
   ✓ Ready in 1052ms
   ✓ Compiled /middleware in 160ms (99 modules)
   ⨯ Error: booooom!
      at <unknown> (./middleware.js:3)
  at eval (../middleware.js:3:12)
  at (middleware)/./middleware.js (../.next/server/middleware.js:40:1)
  at __webpack_require__ (../.next/server/edge-runtime-webpack.js:37:33)
  at fn (../.next/server/edge-runtime-webpack.js:273:21)
  at (middleware)/./node_modules/.pnpm/next@file+..+next-repo-57de865df7ef6f942a2e03a5f866056af2fee2667a5ff5c7eb256dcf0dcc36d0+packa_dyjrbbmik6pudzqveqeayncrsq/node_modules/next/dist/build/webpack/loaders/next-middleware-loader.js?absolutePagePath=%2Ftmp%2Fnext-install-b58a72d87256484997ad349c73d9af7ca2f72dab2939db334ca24ee9aa950e1e%2Fmiddleware.js&page=%2Fmiddleware&rootDir=%2Ftmp%2Fnext-install-b58a72d87256484997ad349c73d9af7ca2f72dab2939db334ca24ee9aa950e1e&matchers=&preferredRegion=&middlewareConfig=e30%3D! (../.next/server/middleware.js:938:1)
  at __webpack_require__ (../.next/server/edge-runtime-webpack.js:37:33)
  at __webpack_exec__ (../.next/server/middleware.js:944:48)
  at <unknown> (../.next/server/middleware.js:945:37)
  at webpackJsonpCallback (../.next/server/edge-runtime-webpack.js:1128:39)
    1 |
    2 |       import { NextResponse } from 'next/server'
  > 3 |       throw new Error('booooom!')
      |            ^
    4 |       export default function () {
    5 |         return NextResponse.next()
    6 |       }
   ✓ Compiled /_error in 267ms (350 modules)
  "
  at Object.toContain (development/middleware-errors/index.test.ts:210:41)

Read more about building and testing Next.js in contributing.md.

@ijjk
Copy link
Member

ijjk commented Dec 6, 2024

Stats from current PR

Default Build
General Overall increase ⚠️
vercel/next.js canary vercel/next.js sokra/dot-slash-prefix-on-relative-paths Change
buildDuration 18.5s 15.9s N/A
buildDurationCached 14.9s 12.5s N/A
nodeModulesSize 391 MB 391 MB ⚠️ +8.17 kB
nextStartRea..uration (ms) 418ms 417ms N/A
Client Bundles (main, webpack)
vercel/next.js canary vercel/next.js sokra/dot-slash-prefix-on-relative-paths Change
5306-HASH.js gzip 54 kB 54 kB N/A
8276.HASH.js gzip 169 B 168 B N/A
8377-HASH.js gzip 5.46 kB 5.46 kB N/A
bccd1874-HASH.js gzip 52.9 kB 52.9 kB N/A
framework-HASH.js gzip 57.5 kB 57.5 kB N/A
main-app-HASH.js gzip 241 B 241 B
main-HASH.js gzip 34.5 kB 34.4 kB N/A
webpack-HASH.js gzip 1.71 kB 1.71 kB N/A
Overall change 241 B 241 B
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js sokra/dot-slash-prefix-on-relative-paths Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Overall change 39.4 kB 39.4 kB
Client Pages
vercel/next.js canary vercel/next.js sokra/dot-slash-prefix-on-relative-paths Change
_app-HASH.js gzip 193 B 193 B
_error-HASH.js gzip 193 B 193 B
amp-HASH.js gzip 512 B 510 B N/A
css-HASH.js gzip 343 B 342 B N/A
dynamic-HASH.js gzip 1.84 kB 1.84 kB
edge-ssr-HASH.js gzip 265 B 265 B
head-HASH.js gzip 363 B 362 B N/A
hooks-HASH.js gzip 393 B 392 B N/A
image-HASH.js gzip 4.59 kB 4.58 kB N/A
index-HASH.js gzip 268 B 268 B
link-HASH.js gzip 2.35 kB 2.35 kB N/A
routerDirect..HASH.js gzip 328 B 328 B
script-HASH.js gzip 397 B 397 B
withRouter-HASH.js gzip 323 B 326 B N/A
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 3.59 kB 3.59 kB
Client Build Manifests
vercel/next.js canary vercel/next.js sokra/dot-slash-prefix-on-relative-paths Change
_buildManifest.js gzip 748 B 747 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js sokra/dot-slash-prefix-on-relative-paths Change
index.html gzip 524 B 524 B
link.html gzip 539 B 538 B N/A
withRouter.html gzip 520 B 520 B
Overall change 1.04 kB 1.04 kB
Edge SSR bundle Size
vercel/next.js canary vercel/next.js sokra/dot-slash-prefix-on-relative-paths Change
edge-ssr.js gzip 129 kB 129 kB N/A
page.js gzip 210 kB 210 kB N/A
Overall change 0 B 0 B
Middleware size
vercel/next.js canary vercel/next.js sokra/dot-slash-prefix-on-relative-paths Change
middleware-b..fest.js gzip 670 B 663 B N/A
middleware-r..fest.js gzip 155 B 156 B N/A
middleware.js gzip 31.3 kB 31.3 kB N/A
edge-runtime..pack.js gzip 844 B 844 B
Overall change 844 B 844 B
Next Runtimes
vercel/next.js canary vercel/next.js sokra/dot-slash-prefix-on-relative-paths Change
app-page-exp...dev.js gzip 385 kB 385 kB
app-page-exp..prod.js gzip 132 kB 132 kB
app-page-tur..prod.js gzip 145 kB 145 kB
app-page-tur..prod.js gzip 141 kB 141 kB
app-page.run...dev.js gzip 372 kB 372 kB
app-page.run..prod.js gzip 128 kB 128 kB
app-route-ex...dev.js gzip 39.3 kB 39.3 kB
app-route-ex..prod.js gzip 25.6 kB 25.6 kB
app-route-tu..prod.js gzip 25.6 kB 25.6 kB
app-route-tu..prod.js gzip 25.4 kB 25.4 kB
app-route.ru...dev.js gzip 40.8 kB 40.8 kB
app-route.ru..prod.js gzip 25.4 kB 25.4 kB
dist_client_...dev.js gzip 356 B 356 B
dist_client_...dev.js gzip 349 B 349 B
pages-api-tu..prod.js gzip 9.69 kB 9.69 kB
pages-api.ru...dev.js gzip 11.8 kB 11.8 kB
pages-api.ru..prod.js gzip 9.68 kB 9.68 kB
pages-turbo...prod.js gzip 21.9 kB 21.9 kB
pages.runtim...dev.js gzip 31.5 kB 31.5 kB
pages.runtim..prod.js gzip 21.9 kB 21.9 kB
server.runti..prod.js gzip 60.2 kB 60.3 kB N/A
Overall change 1.59 MB 1.59 MB
build cache
vercel/next.js canary vercel/next.js sokra/dot-slash-prefix-on-relative-paths Change
0.pack gzip 2.1 MB 2.1 MB N/A
index.pack gzip 75.6 kB 73.9 kB N/A
Overall change 0 B 0 B
Diff details
Diff for main-HASH.js

Diff too large to display

Diff for server.runtime.prod.js

Diff too large to display

Commit: 692085d

@sokra sokra force-pushed the sokra/fix-double-dot-slash branch from 1dcea85 to bb85aa2 Compare December 6, 2024 09:01
@sokra sokra force-pushed the sokra/dot-slash-prefix-on-relative-paths branch 2 times, most recently from 707756f to 262b7a8 Compare December 9, 2024 07:34
@ijjk ijjk added create-next-app Related to our CLI tool for quickly starting a new Next.js application. Documentation Related to Next.js' official documentation. examples Issue was opened via the examples template. Font (next/font) Related to Next.js Font Optimization. Turbopack Related to Turbopack with Next.js. labels Dec 9, 2024
@sokra sokra changed the base branch from sokra/fix-double-dot-slash to sokra/fix-monorepo-paths December 9, 2024 07:34
@sokra sokra force-pushed the sokra/fix-monorepo-paths branch from 466d6b8 to 2b7ca40 Compare December 19, 2024 08:27
@sokra sokra force-pushed the sokra/dot-slash-prefix-on-relative-paths branch 2 times, most recently from 6b0dfff to 3b548a2 Compare December 19, 2024 10:25
@sokra sokra changed the base branch from sokra/fix-monorepo-paths to graphite-base/73585 December 19, 2024 11:56
@sokra sokra force-pushed the graphite-base/73585 branch from 8e343d7 to 53bb90c Compare December 19, 2024 11:59
@sokra sokra force-pushed the sokra/dot-slash-prefix-on-relative-paths branch from 3b548a2 to f9a5997 Compare December 19, 2024 11:59
@sokra sokra changed the base branch from graphite-base/73585 to canary December 19, 2024 12:00
@sokra sokra force-pushed the sokra/dot-slash-prefix-on-relative-paths branch from f9a5997 to 7a2261c Compare December 19, 2024 12:00
@sokra sokra force-pushed the sokra/dot-slash-prefix-on-relative-paths branch from 7a2261c to 692085d Compare February 4, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application. created-by: Turbopack team PRs by the Turbopack team. Documentation Related to Next.js' official documentation. examples Issue was opened via the examples template. Font (next/font) Related to Next.js Font Optimization. tests Turbopack Related to Turbopack with Next.js. type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants