Skip to content

Conversation

@sokra
Copy link
Member

@sokra sokra commented Jan 30, 2026

pass ModulePart correctly for FreeVarReference::EcmaScriptModule

code simplification

reduce code duplication

use EsmExport in FindExportFromReexportsResult

Reorder check

Turbopack: organize tree shaking code

Turbopack: Extract rename module and share between side effects optimization and tree shaking

Turbopack: Tree Shaking imports only internal

@nextjs-bot nextjs-bot added created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js. labels Jan 30, 2026
@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Jan 30, 2026

Failing test suites

Commit: 809d7b7 | About building and testing Next.js

pnpm test-dev-turbo test/e2e/app-dir/actions/app-action-node-middleware.test.ts (turbopack) (job)

Expand output

● Test suite failed to run

Jest encountered an unexpected token

Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

By default "node_modules" folder is ignored by transformers.

Here's what you can do:
 • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
 • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
 • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
 • If you need a custom transformation specify a "transform" option in your config.
 • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/configuration
For information about custom transformations, see:
https://jestjs.io/docs/code-transformation

Details:

/root/actions-runner/_work/next.js/next.js/test/e2e/app-dir/actions/app-action.test.ts:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { FileRef, nextTestSetup } from 'e2e-utils';
                                                                                  ^^^^^^

SyntaxError: Cannot use import statement outside a module

  1 | process.env.TEST_NODE_MIDDLEWARE = 'true'
  2 |
> 3 | require('./app-action.test')
    | ^
  4 |

  at Runtime.createScriptFromCode (../node_modules/.pnpm/jest-runtime@29.7.0/node_modules/jest-runtime/build/index.js:1505:14)
  at Object.require (e2e/app-dir/actions/app-action-node-middleware.test.ts:3:1)

pnpm test-start test/e2e/app-dir/segment-cache/prefetch-runtime/prefetch-runtime.test.ts (job)

  • runtime prefetching > in a private cache > can completely prefetch a page that uses cookies and no uncached IO (DD)
Expand output

● runtime prefetching › in a private cache › can completely prefetch a page that uses cookies and no uncached IO

apiRequestContext.fetch: read ECONNRESET
Call log:
  - → GET http://localhost:44833/in-private-cache/cookies-only?_rsc=180y0
  -   user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/130.0.6723.31 Safari/537.36
  -   accept: */*
  -   accept-encoding: gzip,deflate,br
  -   cookie: testCookie=initialValue
  -   next-test-fetch-priority: low
  -   referer: http://localhost:44833/
  -   next-router-prefetch: 1
  -   next-router-segment-prefetch: /!KGRlZmF1bHQp/in-private-cache
  -   next-url: /
  -   rsc: 1
  -   sec-ch-ua: "Chromium";v="130", "HeadlessChrome";v="130", "Not?A_Brand";v="99"
  -   sec-ch-ua-mobile: ?0
  -   sec-ch-ua-platform: "Linux"

  225 |             // server; we pass the request to the server the immediately.
  226 |             result: (async () => {
> 227 |               const originalResponse = await page.request.fetch(request, {
      |                                                           ^
  228 |                 maxRedirects: 0,
  229 |               })
  230 |

  at fetch (lib/router-act.ts:227:59)
  at lib/router-act.ts:245:13
  at routeHandler (lib/router-act.ts:257:7)

● runtime prefetching › in a private cache › can completely prefetch a page that uses cookies and no uncached IO

apiRequestContext.fetch: read ECONNRESET
Call log:
  - → GET http://localhost:44833/in-private-cache/cookies-only?_rsc=180y0
  -   user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/130.0.6723.31 Safari/537.36
  -   accept: */*
  -   accept-encoding: gzip,deflate,br
  -   cookie: testCookie=initialValue
  -   next-test-fetch-priority: low
  -   referer: http://localhost:44833/
  -   next-router-prefetch: 1
  -   next-router-segment-prefetch: /!KGRlZmF1bHQp/in-private-cache
  -   next-url: /
  -   rsc: 1
  -   sec-ch-ua: "Chromium";v="130", "HeadlessChrome";v="130", "Not?A_Brand";v="99"
  -   sec-ch-ua-mobile: ?0
  -   sec-ch-ua-platform: "Linux"

  225 |             // server; we pass the request to the server the immediately.
  226 |             result: (async () => {
> 227 |               const originalResponse = await page.request.fetch(request, {
      |                                                           ^
  228 |                 maxRedirects: 0,
  229 |               })
  230 |

  at fetch (lib/router-act.ts:227:59)
  at lib/router-act.ts:245:13
  at routeHandler (lib/router-act.ts:257:7)
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 30, 2026

Merging this PR will not alter performance

✅ 17 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing sokra/tree-shaking-fixes (809d7b7) with canary (64328fe)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js.

3 participants