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

feat(turbopack): Add reexports optimization #70336

Draft
wants to merge 28 commits into
base: canary
Choose a base branch
from

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Sep 23, 2024

What?

Create ModulePart::StarReexports and use it to optimize export *-s

package-star/index.js:

export { notCompiled } from "./not-compiled.js";
export { notExisting } from "./not-existing.js";
export { notExecuted } from "./not-executed.js";
export * from "./not-executed.js";
export * from "./a.js";
export * from "./b.js";
export const local = "local";


package-reexport/index.js:

export * from "package-star";
export const outer = "outer";

import { a } from 'package-reexport' currently creates ModulePart::Export("a") for package-reexport and ModulePart::Exports for package-star.

To make side effect optimization work, we need to create ModulePart::Export("a")for export * from "package-star". There are two solutions.

  1. The first one is making ImportMap and EvalContext parameterized by the requested export symbol name. Obviously, this breaks caching.

  2. Special casing star reexports while analyzing imports, and reuse the requested part if it's an export while determining ModulePart for a dependency (import reference) in references/mod.rs.

The first one is not an option, so I did the second way. But now the problem is where it's used by ModulePart::Internal. We need a way to disable resolution when a package is side-effect-free and we don't use export. Currently, we check for side-effect-free modules in turbopack::apply_module_type, but it's not even called for non-existent files. It's because
origin.resolve_asset in specific_resolve returns ModuleResolveResult::unresolvable.


[turbopack/crates/turbopack-resolve/src/ecmascript.rs:147] request = Request :: Relative {
    path: Pattern :: Constant(
        ./not-existing.js,
    ),
    query: ,
    force_in_lookup_dir: false,
    fragment: ,
}
[turbopack/crates/turbopack-resolve/src/ecmascript.rs:147] result = ModuleResolveResult {
    primary: {},
    affecting_sources: [],
}

The unresolvable error is emitted without control from turbopack-ecmascript.

Why?

To improve tree shaking

How?

@kdy1 kdy1 self-assigned this Sep 23, 2024
@ijjk ijjk added created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js. labels Sep 23, 2024
@ijjk
Copy link
Member

ijjk commented Sep 23, 2024

Failing test suites

Commit: 0001b0e

TURBOPACK=1 pnpm test test/integration/app-dynamic-error/test/index.test.ts (turbopack)

  • app-dynamic-error > production mode > throws an error when prerendering a page with config dynamic error
Expand output

● app-dynamic-error › production mode › throws an error when prerendering a page with config dynamic error

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

Expected substring: "Error occurred prerendering page \"/dynamic-error\""
Received string:    " ⚠ Linting is disabled.·
> Build error occurred
[Error: Failed to write app endpoint /_not-found/page·
Caused by:
- failed to analyse ecmascript module '[project]/test/integration/app-dynamic-error/app/layout.js [app-rsc] (ecmascript)'
- could not find part id for module part StarReexports in {ModuleEvaluation: 1, Export(\"default\"): 5, Exports: 6}·
Debug info:
- Execution of get_written_endpoint_with_issues failed
- Execution of <AppEndpoint as Endpoint>::write_to_disk failed
- Failed to write app endpoint /_not-found/page
- Execution of AppEndpoint::output failed
- Execution of *get_app_client_shared_chunk_group failed
- Execution of *get_client_chunking_context failed
- Execution of GlobalModuleIdStrategyBuilder::build failed
- Execution of children_modules_idents failed
- Execution of referenced_modules failed
- Execution of <EcmascriptModulePartAsset as Module>::references failed
- Execution of analyse_ecmascript_module failed
- failed to analyse ecmascript module '[project]/test/integration/app-dynamic-error/app/layout.js [app-rsc] (ecmascript)'
- Execution of part_of_module failed
- could not find part id for module part StarReexports in {ModuleEvaluation: 1, Export(\"default\"): 5, Exports: 6}···
  Module dump:
  # Module #0:
  import \"react/jsx-runtime\";············
  # Module #1:
  import \"__TURBOPACK_PART__\" with {
      __turbopack_part__: 0
  };
  \"module evaluation\";············
  # Module #2:
  import { jsx as _jsx } from \"react/jsx-runtime\";
  export { _jsx as a };············
  # Module #3:
  import { jsxs as _jsxs } from \"react/jsx-runtime\";
  export { _jsxs as b };············
  # Module #4:
  import \"__TURBOPACK_PART__\" with {
      __turbopack_part__: 3
  };
  import \"__TURBOPACK_PART__\" with {
      __turbopack_part__: 2
  };
  import { a as _jsx } from \"__TURBOPACK_PART__\" with {
      __turbopack_part__: 2
  };
  import { b as _jsxs } from \"__TURBOPACK_PART__\" with {
      __turbopack_part__: 3
  };
  function Layout({ children }) {
      return _jsxs(\"html\", {
          lang: \"en\",
          children: [
              _jsx(\"head\", {
                  children: _jsx(\"title\", {
                      children: \"my static blog\"
                  })
              }),
              _jsx(\"body\", {
                  children: children
              })
          ]
      });
  }
  export { Layout as c };············
  # Module #5:
  import \"__TURBOPACK_PART__\" with {
      __turbopack_part__: 4
  };
  import { c as Layout } from \"__TURBOPACK_PART__\" with {
      __turbopack_part__: 4
  };
  export { Layout as default };············
  # Module #6:
  export { default } from \"__TURBOPACK_PART__\" with {
      __turbopack_part__: \"export default\"
  };·········
  ] {
  name: 'TurbopackInternalError'
}
"

  11 |           stdout: true,
  12 |         })
> 13 |         expect(stderr).toContain(
     |                        ^
  14 |           'Error occurred prerendering page "/dynamic-error"'
  15 |         )
  16 |         expect(code).toBe(1)

  at Object.toContain (integration/app-dynamic-error/test/index.test.ts:13:24)

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

TURBOPACK=1 pnpm test test/integration/amphtml-fragment-style/test/index.test.js (turbopack)

  • AMP Fragment Styles > production mode > adds styles from fragment in AMP mode correctly
Expand output

● AMP Fragment Styles › production mode › adds styles from fragment in AMP mode correctly

command failed with code 1 signal null
 ⚠ Linting is disabled.
  ▲ Next.js 15.0.0-canary.163 (turbo)
  - Experiments (use with caution):
    · amp

   Checking validity of types ...
   Creating an optimized production build ...
   Building (0/2) ...
 ✓ Building (2/2)

> Build error occurred
[Error: Failed to write page endpoint /_app

Caused by:
- failed to analyse ecmascript module '[project]/test/integration/amphtml-fragment-style/pages/_document.js [ssr] (ecmascript)'
- could not find part id for module part StarReexports in {ModuleEvaluation: 12, Export("default"): 13, Exports: 14}

Debug info:
- Execution of get_written_endpoint_with_issues failed
- Execution of <PageEndpoint as Endpoint>::write_to_disk failed
- Failed to write page endpoint /_app
- Execution of PageEndpoint::output failed
- Execution of *evaluated_chunk_group_assets failed
- Execution of *get_client_chunking_context failed
- Execution of GlobalModuleIdStrategyBuilder::build failed
- Execution of children_modules_idents failed
- Execution of referenced_modules failed
- Execution of <EcmascriptModulePartAsset as Module>::references failed
- Execution of analyse_ecmascript_module failed
- failed to analyse ecmascript module '[project]/test/integration/amphtml-fragment-style/pages/_document.js [ssr] (ecmascript)'
- Execution of part_of_module failed
- could not find part id for module part StarReexports in {ModuleEvaluation: 12, Export("default"): 13, Exports: 14}
  
  Module dump:
  # Module #0:
  import { NextScript } from 'next/document';
  export { NextScript as a };
  
  
  
  
  # Module #1:
  import { Main } from 'next/document';
  export { Main as b };
  
  
  
  
  # Module #2:
  import { Head } from 'next/document';
  export { Head as c };
  
  
  
  
  # Module #3:
  import { Html } from 'next/document';
  export { Html as d };
  
  
  
  
  # Module #4:
  import { jsx as _jsx } from "react/jsx-runtime";
  export { _jsx as e };
  
  
  
  
  # Module #5:
  import { Fragment as _Fragment } from "react/jsx-runtime";
  export { _Fragment as f };
  
  
  
  
  # Module #6:
  import { jsxs as _jsxs } from "react/jsx-runtime";
  export { _jsxs as g };
  
  
  
  
  # Module #7:
  import Document from 'next/document';
  export { Document as h };
  
  
  
  
  # Module #8:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 7
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 6
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 5
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 4
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 3
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 2
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 1
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 0
  };
  import { h as Document } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 7
  };
  import { g as _jsxs } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 6
  };
  import { f as _Fragment } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 5
  };
  import { e as _jsx } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 4
  };
  import { d as Html } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 3
  };
  import { c as Head } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 2
  };
  import { b as Main } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 1
  };
  import { a as NextScript } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 0
  };
  class MyDocument extends Document {
      static async getInitialProps(ctx) {
          const initialProps = await Document.getInitialProps(ctx);
          return {
              ...initialProps,
              styles: _jsxs(_Fragment, {
                  children: [
                      initialProps.styles,
                      _jsx("style", {
                          dangerouslySetInnerHTML: {
                              __html: `html { background: hotpink; }`
                          }
                      })
                  ]
              })
          };
      }
      render() {
          return _jsxs(Html, {
              children: [
                  _jsx(Head, {}),
                  _jsxs("body", {
                      children: [
                          _jsx(Main, {}),
                          _jsx(NextScript, {})
                      ]
                  })
              ]
          });
      }
  }
  export { MyDocument as i };
  
  
  
  
  # Module #9:
  import "react/jsx-runtime";
  
  
  
  
  # Module #10:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 9
  };
  import 'next/document';
  
  
  
  
  # Module #11:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 8
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 9
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 10
  };
  import { i as MyDocument } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 8
  };
  const __TURBOPACK__default__export__ = MyDocument;
  export { __TURBOPACK__default__export__ as j };
  
  
  
  
  # Module #12:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 9
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 10
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 11
  };
  "module evaluation";
  
  
  
  
  # Module #13:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 11
  };
  import { j as __TURBOPACK__default__export__ } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 11
  };
  export { __TURBOPACK__default__export__ as default };
  
  
  
  
  # Module #14:
  export { default } from "__TURBOPACK_PART__" with {
      __turbopack_part__: "export default"
  };
  
  
  
  ] {
  name: 'TurbopackInternalError'
}

  308 |       ) {
  309 |         return reject(
> 310 |           new Error(
      |           ^
  311 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  312 |           )
  313 |         )

  at ChildProcess.<anonymous> (lib/next-test-utils.ts:310:11)

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

TURBOPACK=1 pnpm test test/integration/auto-export-error-bail/test/index.test.js (turbopack)

  • Auto Export _error bail > production mode > should not opt-out of auto static optimization from invalid _error
Expand output

● Auto Export _error bail › production mode › should not opt-out of auto static optimization from invalid _error

expect(received).toBe(expected) // Object.is equality

Expected: 0
Received: 1

  19 |     const combinedOutput = output.stderr + output.stdout
  20 |
> 21 |     expect(output.code).toBe(0)
     |                         ^
  22 |     expect(combinedOutput).not.toContain(
  23 |       'You have opted-out of Automatic Static Optimization due to'
  24 |     )

  at Object.toBe (integration/auto-export-error-bail/test/index.test.js:21:25)

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

TURBOPACK=1 pnpm test-start test/e2e/app-dir/dynamic-css/index.test.ts (turbopack)

  • app dir - dynamic css > should preload all chunks of dynamic component during SSR
  • app dir - dynamic css > should only apply corresponding css for page loaded that /ssr
  • app dir - dynamic css > should only apply corresponding css for page loaded in edge runtime
  • app dir - dynamic css > should only apply corresponding css for page loaded that /another
  • app dir - dynamic css > should not throw with accessing to ALS in preload css
Expand output

● app dir - dynamic css › should preload all chunks of dynamic component during SSR

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - dynamic css › should only apply corresponding css for page loaded that /ssr

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - dynamic css › should only apply corresponding css for page loaded in edge runtime

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - dynamic css › should only apply corresponding css for page loaded that /another

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - dynamic css › should not throw with accessing to ALS in preload css

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

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

TURBOPACK=1 pnpm test test/integration/critical-css/test/index.test.js (turbopack)

  • CSS optimization for SSR apps > production mode > should have all CSS files in manifest
  • CSS optimization for SSR apps > production mode > should inline critical CSS
  • CSS optimization for SSR apps > production mode > should inline critical CSS (dynamic)
  • CSS optimization for SSR apps > production mode > should not inline non-critical css
Expand output

● CSS optimization for SSR apps › production mode › should have all CSS files in manifest

command failed with code 1 signal null
 ⚠ Linting is disabled.
  ▲ Next.js 15.0.0-canary.163 (turbo)
  - Experiments (use with caution):
    · optimizeCss

   Checking validity of types ...
   Creating an optimized production build ...
   Building (0/3) ...
 ✓ Building (3/3)

> Build error occurred
[Error: Failed to write page endpoint /_app

Caused by:
- failed to analyse ecmascript module '[project]/test/integration/critical-css/pages/_app.js [ssr] (ecmascript)'
- could not find part id for module part StarReexports in {ModuleEvaluation: 5, Export("default"): 2, Exports: 6}

Debug info:
- Execution of get_written_endpoint_with_issues failed
- Execution of <PageEndpoint as Endpoint>::write_to_disk failed
- Failed to write page endpoint /_app
- Execution of PageEndpoint::output failed
- Execution of *evaluated_chunk_group_assets failed
- Execution of *get_client_chunking_context failed
- Execution of GlobalModuleIdStrategyBuilder::build failed
- Execution of children_modules_idents failed
- Execution of referenced_modules failed
- Execution of <EcmascriptModulePartAsset as Module>::references failed
- Execution of analyse_ecmascript_module failed
- failed to analyse ecmascript module '[project]/test/integration/critical-css/pages/_app.js [ssr] (ecmascript)'
- Execution of part_of_module failed
- could not find part id for module part StarReexports in {ModuleEvaluation: 5, Export("default"): 2, Exports: 6}
  
  Module dump:
  # Module #0:
  import { jsx as _jsx } from "react/jsx-runtime";
  export { _jsx as a };
  
  
  
  
  # Module #1:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 0
  };
  import { a as _jsx } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 0
  };
  function MyApp({ Component, pageProps }) {
      return _jsx(Component, {
          ...pageProps
      });
  }
  export { MyApp as b };
  
  
  
  
  # Module #2:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 1
  };
  import { b as MyApp } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 1
  };
  export { MyApp as default };
  
  
  
  
  # Module #3:
  import "react/jsx-runtime";
  
  
  
  
  # Module #4:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 3
  };
  import '../styles/styles.css';
  
  
  
  
  # Module #5:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 3
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 4
  };
  "module evaluation";
  
  
  
  
  # Module #6:
  export { default } from "__TURBOPACK_PART__" with {
      __turbopack_part__: "export default"
  };
  
  
  
  ] {
  name: 'TurbopackInternalError'
}

  308 |       ) {
  309 |         return reject(
> 310 |           new Error(
      |           ^
  311 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  312 |           )
  313 |         )

  at ChildProcess.<anonymous> (lib/next-test-utils.ts:310:11)

● CSS optimization for SSR apps › production mode › should inline critical CSS

command failed with code 1 signal null
 ⚠ Linting is disabled.
  ▲ Next.js 15.0.0-canary.163 (turbo)
  - Experiments (use with caution):
    · optimizeCss

   Checking validity of types ...
   Creating an optimized production build ...
   Building (0/3) ...
 ✓ Building (3/3)

> Build error occurred
[Error: Failed to write page endpoint /_app

Caused by:
- failed to analyse ecmascript module '[project]/test/integration/critical-css/pages/_app.js [ssr] (ecmascript)'
- could not find part id for module part StarReexports in {ModuleEvaluation: 5, Export("default"): 2, Exports: 6}

Debug info:
- Execution of get_written_endpoint_with_issues failed
- Execution of <PageEndpoint as Endpoint>::write_to_disk failed
- Failed to write page endpoint /_app
- Execution of PageEndpoint::output failed
- Execution of *evaluated_chunk_group_assets failed
- Execution of *get_client_chunking_context failed
- Execution of GlobalModuleIdStrategyBuilder::build failed
- Execution of children_modules_idents failed
- Execution of referenced_modules failed
- Execution of <EcmascriptModulePartAsset as Module>::references failed
- Execution of analyse_ecmascript_module failed
- failed to analyse ecmascript module '[project]/test/integration/critical-css/pages/_app.js [ssr] (ecmascript)'
- Execution of part_of_module failed
- could not find part id for module part StarReexports in {ModuleEvaluation: 5, Export("default"): 2, Exports: 6}
  
  Module dump:
  # Module #0:
  import { jsx as _jsx } from "react/jsx-runtime";
  export { _jsx as a };
  
  
  
  
  # Module #1:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 0
  };
  import { a as _jsx } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 0
  };
  function MyApp({ Component, pageProps }) {
      return _jsx(Component, {
          ...pageProps
      });
  }
  export { MyApp as b };
  
  
  
  
  # Module #2:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 1
  };
  import { b as MyApp } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 1
  };
  export { MyApp as default };
  
  
  
  
  # Module #3:
  import "react/jsx-runtime";
  
  
  
  
  # Module #4:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 3
  };
  import '../styles/styles.css';
  
  
  
  
  # Module #5:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 3
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 4
  };
  "module evaluation";
  
  
  
  
  # Module #6:
  export { default } from "__TURBOPACK_PART__" with {
      __turbopack_part__: "export default"
  };
  
  
  
  ] {
  name: 'TurbopackInternalError'
}

  308 |       ) {
  309 |         return reject(
> 310 |           new Error(
      |           ^
  311 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  312 |           )
  313 |         )

  at ChildProcess.<anonymous> (lib/next-test-utils.ts:310:11)

● CSS optimization for SSR apps › production mode › should inline critical CSS (dynamic)

command failed with code 1 signal null
 ⚠ Linting is disabled.
  ▲ Next.js 15.0.0-canary.163 (turbo)
  - Experiments (use with caution):
    · optimizeCss

   Checking validity of types ...
   Creating an optimized production build ...
   Building (0/3) ...
 ✓ Building (3/3)

> Build error occurred
[Error: Failed to write page endpoint /_app

Caused by:
- failed to analyse ecmascript module '[project]/test/integration/critical-css/pages/_app.js [ssr] (ecmascript)'
- could not find part id for module part StarReexports in {ModuleEvaluation: 5, Export("default"): 2, Exports: 6}

Debug info:
- Execution of get_written_endpoint_with_issues failed
- Execution of <PageEndpoint as Endpoint>::write_to_disk failed
- Failed to write page endpoint /_app
- Execution of PageEndpoint::output failed
- Execution of *evaluated_chunk_group_assets failed
- Execution of *get_client_chunking_context failed
- Execution of GlobalModuleIdStrategyBuilder::build failed
- Execution of children_modules_idents failed
- Execution of referenced_modules failed
- Execution of <EcmascriptModulePartAsset as Module>::references failed
- Execution of analyse_ecmascript_module failed
- failed to analyse ecmascript module '[project]/test/integration/critical-css/pages/_app.js [ssr] (ecmascript)'
- Execution of part_of_module failed
- could not find part id for module part StarReexports in {ModuleEvaluation: 5, Export("default"): 2, Exports: 6}
  
  Module dump:
  # Module #0:
  import { jsx as _jsx } from "react/jsx-runtime";
  export { _jsx as a };
  
  
  
  
  # Module #1:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 0
  };
  import { a as _jsx } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 0
  };
  function MyApp({ Component, pageProps }) {
      return _jsx(Component, {
          ...pageProps
      });
  }
  export { MyApp as b };
  
  
  
  
  # Module #2:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 1
  };
  import { b as MyApp } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 1
  };
  export { MyApp as default };
  
  
  
  
  # Module #3:
  import "react/jsx-runtime";
  
  
  
  
  # Module #4:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 3
  };
  import '../styles/styles.css';
  
  
  
  
  # Module #5:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 3
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 4
  };
  "module evaluation";
  
  
  
  
  # Module #6:
  export { default } from "__TURBOPACK_PART__" with {
      __turbopack_part__: "export default"
  };
  
  
  
  ] {
  name: 'TurbopackInternalError'
}

  308 |       ) {
  309 |         return reject(
> 310 |           new Error(
      |           ^
  311 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  312 |           )
  313 |         )

  at ChildProcess.<anonymous> (lib/next-test-utils.ts:310:11)

● CSS optimization for SSR apps › production mode › should not inline non-critical css

command failed with code 1 signal null
 ⚠ Linting is disabled.
  ▲ Next.js 15.0.0-canary.163 (turbo)
  - Experiments (use with caution):
    · optimizeCss

   Checking validity of types ...
   Creating an optimized production build ...
   Building (0/3) ...
 ✓ Building (3/3)

> Build error occurred
[Error: Failed to write page endpoint /_app

Caused by:
- failed to analyse ecmascript module '[project]/test/integration/critical-css/pages/_app.js [ssr] (ecmascript)'
- could not find part id for module part StarReexports in {ModuleEvaluation: 5, Export("default"): 2, Exports: 6}

Debug info:
- Execution of get_written_endpoint_with_issues failed
- Execution of <PageEndpoint as Endpoint>::write_to_disk failed
- Failed to write page endpoint /_app
- Execution of PageEndpoint::output failed
- Execution of *evaluated_chunk_group_assets failed
- Execution of *get_client_chunking_context failed
- Execution of GlobalModuleIdStrategyBuilder::build failed
- Execution of children_modules_idents failed
- Execution of referenced_modules failed
- Execution of <EcmascriptModulePartAsset as Module>::references failed
- Execution of analyse_ecmascript_module failed
- failed to analyse ecmascript module '[project]/test/integration/critical-css/pages/_app.js [ssr] (ecmascript)'
- Execution of part_of_module failed
- could not find part id for module part StarReexports in {ModuleEvaluation: 5, Export("default"): 2, Exports: 6}
  
  Module dump:
  # Module #0:
  import { jsx as _jsx } from "react/jsx-runtime";
  export { _jsx as a };
  
  
  
  
  # Module #1:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 0
  };
  import { a as _jsx } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 0
  };
  function MyApp({ Component, pageProps }) {
      return _jsx(Component, {
          ...pageProps
      });
  }
  export { MyApp as b };
  
  
  
  
  # Module #2:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 1
  };
  import { b as MyApp } from "__TURBOPACK_PART__" with {
      __turbopack_part__: 1
  };
  export { MyApp as default };
  
  
  
  
  # Module #3:
  import "react/jsx-runtime";
  
  
  
  
  # Module #4:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 3
  };
  import '../styles/styles.css';
  
  
  
  
  # Module #5:
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 3
  };
  import "__TURBOPACK_PART__" with {
      __turbopack_part__: 4
  };
  "module evaluation";
  
  
  
  
  # Module #6:
  export { default } from "__TURBOPACK_PART__" with {
      __turbopack_part__: "export default"
  };
  
  
  
  ] {
  name: 'TurbopackInternalError'
}

  308 |       ) {
  309 |         return reject(
> 310 |           new Error(
      |           ^
  311 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  312 |           )
  313 |         )

  at ChildProcess.<anonymous> (lib/next-test-utils.ts:310:11)

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

TURBOPACK=1 pnpm test-start test/e2e/app-dir/app-basepath/index.test.ts (turbopack)

  • app dir - basepath > should successfully hard navigate from pages -> app
  • app dir - basepath > should support basePath
  • app dir - basepath > should support Link with basePath prefixed
  • app dir - basepath > should prefix metadata og image with basePath
  • app dir - basepath > should prefix redirect() with basePath
  • app dir - basepath > should render usePathname without the basePath
  • app dir - basepath > should handle redirect in dynamic in suspense boundary routes with basePath
  • app dir - basepath > should only make a single RSC call to the current page (/base/refresh)
  • app dir - basepath > should only make a single RSC call to the current page (/base/refresh?foo=bar)
  • app dir - basepath > should properly stream an internal server action redirect() with a relative URL
  • app dir - basepath > should properly stream an internal server action redirect() with a absolute URL
  • app dir - basepath > should redirect externally when encountering absolute URLs on the same host outside the basePath
Expand output

● app dir - basepath › should successfully hard navigate from pages -> app

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should support basePath

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should support Link with basePath prefixed

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should prefix metadata og image with basePath

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should prefix redirect() with basePath

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should render usePathname without the basePath

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should handle redirect in dynamic in suspense boundary routes with basePath

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should only make a single RSC call to the current page (/base/refresh)

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should only make a single RSC call to the current page (/base/refresh?foo=bar)

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should properly stream an internal server action redirect() with a relative URL

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should properly stream an internal server action redirect() with a absolute URL

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir - basepath › should redirect externally when encountering absolute URLs on the same host outside the basePath

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

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

TURBOPACK=1 pnpm test-start test/e2e/app-dir/app-client-cache/client-cache.defaults.test.ts (turbopack)

  • app dir client cache semantics (default semantics) > should renew the initial seeded data after expiration time
  • app dir client cache semantics (default semantics) > prefetch={false} > should not prefetch the page at all
  • app dir client cache semantics (default semantics) > prefetch={false} > should not re-use the page segment cache
  • app dir client cache semantics (default semantics) > prefetch={true} > should prefetch the full page
  • app dir client cache semantics (default semantics) > prefetch={true} > should re-use the cache for the full page, only for 5 mins
  • app dir client cache semantics (default semantics) > prefetch={true} > should prefetch again after 5 mins if the link is visible again
  • app dir client cache semantics (default semantics) > prefetch={undefined} - default > should prefetch partially a dynamic page
  • app dir client cache semantics (default semantics) > prefetch={undefined} - default > should not re-use the page segment cache
  • app dir client cache semantics (default semantics) > prefetch={undefined} - default > should refetch the full page after 5 mins
  • app dir client cache semantics (default semantics) > prefetch={undefined} - default > should respect a loading boundary that returns null
Expand output

● app dir client cache semantics (default semantics) › prefetch={true} › should prefetch the full page

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir client cache semantics (default semantics) › prefetch={true} › should re-use the cache for the full page, only for 5 mins

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir client cache semantics (default semantics) › prefetch={true} › should prefetch again after 5 mins if the link is visible again

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir client cache semantics (default semantics) › prefetch={false} › should not prefetch the page at all

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir client cache semantics (default semantics) › prefetch={false} › should not re-use the page segment cache

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir client cache semantics (default semantics) › prefetch={undefined} - default › should prefetch partially a dynamic page

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir client cache semantics (default semantics) › prefetch={undefined} - default › should not re-use the page segment cache

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir client cache semantics (default semantics) › prefetch={undefined} - default › should refetch the full page after 5 mins

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir client cache semantics (default semantics) › prefetch={undefined} - default › should respect a loading boundary that returns null

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app dir client cache semantics (default semantics) › should renew the initial seeded data after expiration time

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

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

TURBOPACK=1 pnpm test test/integration/404-page-ssg/test/index.test.js (turbopack)

  • 404 Page Support SSG > production mode > should build successfully
  • 404 Page Support SSG > production mode > should respond to 404 correctly
  • 404 Page Support SSG > production mode > should render error correctly
  • 404 Page Support SSG > production mode > should not show an error in the logs for 404 SSG
  • 404 Page Support SSG > production mode > should render index page normal
  • 404 Page Support SSG > production mode > should not revalidate custom 404 page
  • 404 Page Support SSG > production mode > should set pages404 in routes-manifest correctly
  • 404 Page Support SSG > production mode > should have 404 page in prerender-manifest
Expand output

● 404 Page Support SSG › production mode › should build successfully

expect(received).toBe(expected) // Object.is equality

Expected: 0
Received: 1

  92 |         })
  93 |
> 94 |         expect(code).toBe(0)
     |                      ^
  95 |         expect(buildStderr).not.toMatch(gip404Err)
  96 |         expect(buildStdout).not.toMatch(gip404Err)
  97 |

  at Object.toBe (integration/404-page-ssg/test/index.test.js:94:22)

● 404 Page Support SSG › production mode › should respond to 404 correctly

TypeError: Invalid URL

  175 | ): Promise<Response> {
  176 |   const url = query ? withQuery(pathname, query) : pathname
> 177 |   return fetch(getFullUrl(appPort, url), opts)
      |               ^
  178 | }
  179 |
  180 | export function renderViaHTTP(

  at parseURL (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1164:12)
  at new Request (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1210:17)
  at ../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1439:19
  at fetch (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1437:9)
  at fetchViaHTTP (lib/next-test-utils.ts:177:15)
  at Object.<anonymous> (integration/404-page-ssg/test/index.test.js:27:35)

● 404 Page Support SSG › production mode › should render error correctly

TypeError: Invalid URL

  175 | ): Promise<Response> {
  176 |   const url = query ? withQuery(pathname, query) : pathname
> 177 |   return fetch(getFullUrl(appPort, url), opts)
      |               ^
  178 | }
  179 |
  180 | export function renderViaHTTP(

  at parseURL (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1164:12)
  at new Request (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1210:17)
  at ../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1439:19
  at fetch (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1437:9)
  at fetchViaHTTP (lib/next-test-utils.ts:177:15)
  at fetchViaHTTP (lib/next-test-utils.ts:186:10)
  at Object.<anonymous> (integration/404-page-ssg/test/index.test.js:33:37)

● 404 Page Support SSG › production mode › should not show an error in the logs for 404 SSG

TypeError: Invalid URL

  175 | ): Promise<Response> {
  176 |   const url = query ? withQuery(pathname, query) : pathname
> 177 |   return fetch(getFullUrl(appPort, url), opts)
      |               ^
  178 | }
  179 |
  180 | export function renderViaHTTP(

  at parseURL (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1164:12)
  at new Request (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1210:17)
  at ../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1439:19
  at fetch (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1437:9)
  at fetchViaHTTP (lib/next-test-utils.ts:177:15)
  at fetchViaHTTP (lib/next-test-utils.ts:186:10)
  at Object.<anonymous> (integration/404-page-ssg/test/index.test.js:38:24)

● 404 Page Support SSG › production mode › should render index page normal

TypeError: Invalid URL

  175 | ): Promise<Response> {
  176 |   const url = query ? withQuery(pathname, query) : pathname
> 177 |   return fetch(getFullUrl(appPort, url), opts)
      |               ^
  178 | }
  179 |
  180 | export function renderViaHTTP(

  at parseURL (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1164:12)
  at new Request (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1210:17)
  at ../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1439:19
  at fetch (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1437:9)
  at fetchViaHTTP (lib/next-test-utils.ts:177:15)
  at fetchViaHTTP (lib/next-test-utils.ts:186:10)
  at Object.<anonymous> (integration/404-page-ssg/test/index.test.js:44:37)

● 404 Page Support SSG › production mode › should not revalidate custom 404 page

TypeError: Invalid URL

  175 | ): Promise<Response> {
  176 |   const url = query ? withQuery(pathname, query) : pathname
> 177 |   return fetch(getFullUrl(appPort, url), opts)
      |               ^
  178 | }
  179 |
  180 | export function renderViaHTTP(

  at parseURL (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1164:12)
  at new Request (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1210:17)
  at ../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1439:19
  at fetch (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1437:9)
  at fetchViaHTTP (lib/next-test-utils.ts:177:15)
  at fetchViaHTTP (lib/next-test-utils.ts:186:10)
  at Object.<anonymous> (integration/404-page-ssg/test/index.test.js:50:39)

● 404 Page Support SSG › production mode › should set pages404 in routes-manifest correctly

ENOENT: no such file or directory, open '/root/actions-runner/_work/next.js/next.js/test/integration/404-page-ssg/.next/routes-manifest.json'

● 404 Page Support SSG › production mode › should have 404 page in prerender-manifest

ENOENT: no such file or directory, open '/root/actions-runner/_work/next.js/next.js/test/integration/404-page-ssg/.next/prerender-manifest.json'

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

TURBOPACK=1 pnpm test-start test/e2e/app-dir/app-edge/app-edge.test.ts (turbopack)

  • app-dir edge SSR > should handle edge only routes
  • app-dir edge SSR > should retrieve cookies in a server component in the edge runtime
  • app-dir edge SSR > should treat process as object without polyfill in edge runtime
  • app-dir edge SSR > should handle /index routes correctly
Expand output

● app-dir edge SSR › should handle edge only routes

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app-dir edge SSR › should retrieve cookies in a server component in the edge runtime

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app-dir edge SSR › should treat process as object without polyfill in edge runtime

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app-dir edge SSR › should handle /index routes correctly

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app-dir edge SSR › should generate matchers correctly in middleware manifest

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

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

TURBOPACK=1 pnpm test-start test/e2e/app-dir/app-prefetch-false-loading/app-prefetch-false-loading.test.ts (turbopack)

  • app-prefetch-false-loading > should render loading for the initial render
  • app-prefetch-false-loading > should not re-trigger loading state when navigating between pages that share a dynamic layout
Expand output

● app-prefetch-false-loading › should render loading for the initial render

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

● app-prefetch-false-loading › should not re-trigger loading state when navigating between pages that share a dynamic layout

next build failed with code/signal 1

   98 |           if (code || signal)
   99 |             reject(
> 100 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  101 |             )
  102 |           else resolve()
  103 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:100:15)

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

TURBOPACK=1 pnpm test-dev test/e2e/app-dir/app-external/app-external.test.ts (turbopack)

  • app dir - external dependency > should support exporting multiple star re-exports
Expand output

● app dir - external dependency › should support exporting multiple star re-exports