Skip to content

Move webpack implementation into package folder#94129

Draft
timneutkens wants to merge 6 commits into
canaryfrom
codex/move-webpack-folder
Draft

Move webpack implementation into package folder#94129
timneutkens wants to merge 6 commits into
canaryfrom
codex/move-webpack-folder

Conversation

@timneutkens
Copy link
Copy Markdown
Contributor

What?

Move the webpack implementation into packages/next/src/webpack inside the next package, with lazy Next core integration for webpack/rspack paths. Keep shared Babel and Sass compatibility code in neutral core build locations, including resolve-url-loader under packages/next/src/build/resolve-url-loader.

Why?

Webpack is now opt-in, and keeping its implementation in a dedicated folder makes the support code easier to remove cleanly in the future while preserving next --webpack and config.webpack behavior.

How?

Relocated webpack build/dev/loaders/plugins/vendor files under src/webpack, added next/dist/webpack/next-integration as the internal lazy integration entry, moved shared manifest/trace/dev-page types to neutral core modules, updated Next-owned tests/scripts/storybook references, and adjusted package build output so webpack files compile to dist/webpack. Generated webpack bundles and compiled webpack vendor files are ignored at their new paths.

Verification

  • pnpm --filter=next build
  • pnpm --filter=next types
  • pnpm pack-next --no-js-build --tar
  • NEXT_TEST_PREFER_OFFLINE=1 pnpm test-dev-webpack test/e2e/webpack-require-hook/webpack-require-hook.test.ts
  • NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-webpack test/production/webpack-config-mainjs/webpack-config-mainjs.test.ts
  • NEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-rspack test/e2e/hello-world/hello-world.test.ts
  • NEXT_TEST_PREFER_OFFLINE=1 pnpm test-dev-turbo test/e2e/app-dir/scss/basic-module/basic-module.test.ts
  • NEXT_TEST_PREFER_OFFLINE=1 pnpm test-dev-webpack test/e2e/app-dir/scss/basic-module/basic-module.test.ts
  • pnpm jest test/unit/next-babel-loader-dev.test.ts test/unit/next-babel-loader-prod.test.ts
  • pre-commit lint-staged

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

Stats cancelled

Commit: 58b95ac
View workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

Failing test suites

Commit: 58b95ac | About building and testing Next.js

pnpm test-dev test/development/app-dir/instant-navs-devtools/instant-navs-devtools.test.ts (job)

  • instant-nav-panel > transitions between capture types > should avoid showing stale SPA state when reloading from a captured SPA state into captured MPA state (DD)
Expand output

● instant-nav-panel › transitions between capture types › should avoid showing stale SPA state when reloading from a captured SPA state into captured MPA state

locator.waitFor: Timeout 30000ms exceeded.
Call log:
  - waiting for locator('[data-testid="dynamic-skeleton"]') to be visible

  206 |     await browser
  207 |       .locator('[data-testid="dynamic-skeleton"]')
> 208 |       .waitFor({ state: 'visible', timeout: 30000 })
      |        ^
  209 |     await browser
  210 |       .locator('[data-testid="param-skeleton"]')
  211 |       .waitFor({ state: 'visible' })

  at waitFor (development/app-dir/instant-navs-devtools/instant-navs-devtools.test.ts:208:8)
  at Object.expectTargetPageMpaShell (development/app-dir/instant-navs-devtools/instant-navs-devtools.test.ts:579:13)

pnpm test-dev test/e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts (job)

  • Instrumentation Client Hook > App Router > should execute instrumentation-client from app router before hydration (DD)
  • Instrumentation Client Hook > HMR in development mode > should reload instrumentation-client when modified (DD)
  • Instrumentation Client Hook > Pages Router > should execute instrumentation-client from pages router before hydration (DD)
  • Instrumentation Client Hook > With src folder > should execute instrumentation-client from with src folder before hydration (DD)
  • Instrumentation Client Hook > instrumentationClientInject > runs each injected entry before the user instrumentation-client and before hydration, in array order (DD)
  • Instrumentation Client Hook > instrumentationClientInject > still surfaces onRouterTransitionStart from the user instrumentation-client when injects are configured (DD)
  • Instrumentation Client Hook > onRouterTransitionStart > onRouterTransitionStart fires at the start of a navigation (DD)
  • Instrumentation Client Hook > onRouterTransitionStart > onRouterTransitionStart fires at the start of a back/forward navigation (DD)
Expand output

● Instrumentation Client Hook › With src folder › should execute instrumentation-client from with src folder before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › App Router › should execute instrumentation-client from app router before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › Pages Router › should execute instrumentation-client from pages router before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › onRouterTransitionStart › onRouterTransitionStart fires at the start of a navigation

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

- Expected  - 4
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page",
-   "[Router Transition Start] [push] /",
- ]
+ Array []

  76 |       await browser.elementById('home')
  77 |
> 78 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
     |                                                              ^
  79 |         '[Router Transition Start] [push] /some-page',
  80 |         '[Router Transition Start] [push] /',
  81 |       ])

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:78:62)

● Instrumentation Client Hook › onRouterTransitionStart › onRouterTransitionStart fires at the start of a back/forward navigation

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

- Expected  - 5
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page",
-   "[Router Transition Start] [traverse] /",
-   "[Router Transition Start] [traverse] /some-page",
- ]
+ Array []

   95 |       await browser.elementById('some-page')
   96 |
>  97 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
      |                                                              ^
   98 |         '[Router Transition Start] [push] /some-page',
   99 |         '[Router Transition Start] [traverse] /',
  100 |         '[Router Transition Start] [traverse] /some-page',

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:97:62)

● Instrumentation Client Hook › instrumentationClientInject › runs each injected entry before the user instrumentation-client and before hydration, in array order

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

Expected: ["a", "b", "user"]
Received: undefined

  112 |
  113 |       const order = await browser.eval(`window.__INJECT_ORDER`)
> 114 |       expect(order).toEqual(['a', 'b', 'user'])
      |                     ^
  115 |
  116 |       const injectA = await browser.eval(`window.__INJECT_A_EXECUTED_AT`)
  117 |       const injectB = await browser.eval(`window.__INJECT_B_EXECUTED_AT`)

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:114:21)

● Instrumentation Client Hook › instrumentationClientInject › still surfaces onRouterTransitionStart from the user instrumentation-client when injects are configured

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

- Expected  - 8
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page a",
-   "[Router Transition Start] [push] /some-page b",
-   "[Router Transition Start] [push] /some-page user",
-   "[Router Transition Start] [push] / a",
-   "[Router Transition Start] [push] / b",
-   "[Router Transition Start] [push] / user",
- ]
+ Array []

  142 |       await browser.elementById('home')
  143 |
> 144 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
      |                                                              ^
  145 |         '[Router Transition Start] [push] /some-page a',
  146 |         '[Router Transition Start] [push] /some-page b',
  147 |         '[Router Transition Start] [push] /some-page user',

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:144:62)

● Instrumentation Client Hook › HMR in development mode › should reload instrumentation-client when modified

expect(received).toBeDefined()

Received: undefined

  164 |           `window.__INSTRUMENTATION_CLIENT_EXECUTED_AT`
  165 |         )
> 166 |         expect(initialTime).toBeDefined()
      |                             ^
  167 |
  168 |         // Modify the instrumentation-client.ts file
  169 |         const instrumentationPath = 'instrumentation-client.ts'

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:166:29)

pnpm test-dev test/e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts (job)

  • instant-navigation-testing-api > renders runtime-prefetched content instantly during navigation (DD)
Expand output

● instant-navigation-testing-api › renders runtime-prefetched content instantly during navigation

locator.waitFor: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('[data-testid="search-param-value"]') to be visible

  105 |         '[data-testid="search-param-value"]'
  106 |       )
> 107 |       await searchParamValue.waitFor({ state: 'visible' })
      |                              ^
  108 |       expect(await searchParamValue.textContent()).toContain(
  109 |         'myParam: testValue'
  110 |       )

  at waitFor (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:107:30)
  at instant (../packages/next-playwright/dist/index.js:50:16)
  at Object.<anonymous> (e2e/app-dir/instant-navigation-testing-api/instant-navigation-testing-api.test.ts:99:5)

pnpm test-start test/e2e/app-dir/next-config/index.test.ts (job)

  • app dir - next config > should support importing webpack in next.config (DD)
Expand output

● app dir - next config › should support importing webpack in next.config

FetchError: request to http://localhost:46779/ failed, reason: connect ECONNREFUSED 127.0.0.1:46779

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1491:11)

pnpm test-start test/e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts (job)

  • Instrumentation Client Hook > App Router > should execute instrumentation-client from app router before hydration (DD)
  • Instrumentation Client Hook > Pages Router > should execute instrumentation-client from pages router before hydration (DD)
  • Instrumentation Client Hook > With src folder > should execute instrumentation-client from with src folder before hydration (DD)
  • Instrumentation Client Hook > instrumentationClientInject > runs each injected entry before the user instrumentation-client and before hydration, in array order (DD)
  • Instrumentation Client Hook > instrumentationClientInject > still surfaces onRouterTransitionStart from the user instrumentation-client when injects are configured (DD)
  • Instrumentation Client Hook > onRouterTransitionStart > onRouterTransitionStart fires at the start of a navigation (DD)
  • Instrumentation Client Hook > onRouterTransitionStart > onRouterTransitionStart fires at the start of a back/forward navigation (DD)
Expand output

● Instrumentation Client Hook › With src folder › should execute instrumentation-client from with src folder before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › App Router › should execute instrumentation-client from app router before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › Pages Router › should execute instrumentation-client from pages router before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › onRouterTransitionStart › onRouterTransitionStart fires at the start of a navigation

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

- Expected  - 4
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page",
-   "[Router Transition Start] [push] /",
- ]
+ Array []

  76 |       await browser.elementById('home')
  77 |
> 78 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
     |                                                              ^
  79 |         '[Router Transition Start] [push] /some-page',
  80 |         '[Router Transition Start] [push] /',
  81 |       ])

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:78:62)

● Instrumentation Client Hook › onRouterTransitionStart › onRouterTransitionStart fires at the start of a back/forward navigation

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

- Expected  - 5
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page",
-   "[Router Transition Start] [traverse] /",
-   "[Router Transition Start] [traverse] /some-page",
- ]
+ Array []

   95 |       await browser.elementById('some-page')
   96 |
>  97 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
      |                                                              ^
   98 |         '[Router Transition Start] [push] /some-page',
   99 |         '[Router Transition Start] [traverse] /',
  100 |         '[Router Transition Start] [traverse] /some-page',

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:97:62)

● Instrumentation Client Hook › instrumentationClientInject › runs each injected entry before the user instrumentation-client and before hydration, in array order

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

Expected: ["a", "b", "user"]
Received: undefined

  112 |
  113 |       const order = await browser.eval(`window.__INJECT_ORDER`)
> 114 |       expect(order).toEqual(['a', 'b', 'user'])
      |                     ^
  115 |
  116 |       const injectA = await browser.eval(`window.__INJECT_A_EXECUTED_AT`)
  117 |       const injectB = await browser.eval(`window.__INJECT_B_EXECUTED_AT`)

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:114:21)

● Instrumentation Client Hook › instrumentationClientInject › still surfaces onRouterTransitionStart from the user instrumentation-client when injects are configured

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

- Expected  - 8
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page a",
-   "[Router Transition Start] [push] /some-page b",
-   "[Router Transition Start] [push] /some-page user",
-   "[Router Transition Start] [push] / a",
-   "[Router Transition Start] [push] / b",
-   "[Router Transition Start] [push] / user",
- ]
+ Array []

  142 |       await browser.elementById('home')
  143 |
> 144 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
      |                                                              ^
  145 |         '[Router Transition Start] [push] /some-page a',
  146 |         '[Router Transition Start] [push] /some-page b',
  147 |         '[Router Transition Start] [push] /some-page user',

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:144:62)

pnpm test-start test/production/app-dir/actions-tree-shaking/client-actions-tree-shaking/client-actions-tree-shaking.test.ts (job)

  • app-dir - client-actions-tree-shaking > should not bundle unused server reference id in client bundles (DD)
Expand output

● app-dir - client-actions-tree-shaking › should not bundle unused server reference id in client bundles

expect(received).toHaveLength(expected)

Expected length: 1
Received length: 2
Received array:  ["003f7fd42394926e7f0082c0a3ca82f9fd7c6740d2", "00433d59657cfc5bf7b29eccd7d925c96666add579"]

   95 |
   96 |     // Bundle 1 and 2 should only have one ID.
>  97 |     expect(bundle1Ids).toHaveLength(1)
      |                        ^
   98 |     expect(bundle2Ids).toHaveLength(1)
   99 |     expect(bundle1Ids[0]).not.toEqual(bundle2Ids[0])
  100 |

  at Object.toHaveLength (production/app-dir/actions-tree-shaking/client-actions-tree-shaking/client-actions-tree-shaking.test.ts:97:24)

pnpm test-dev test/e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts (job)

  • Instrumentation Client Hook > App Router > should execute instrumentation-client from app router before hydration (DD)
  • Instrumentation Client Hook > HMR in development mode > should reload instrumentation-client when modified (DD)
  • Instrumentation Client Hook > Pages Router > should execute instrumentation-client from pages router before hydration (DD)
  • Instrumentation Client Hook > With src folder > should execute instrumentation-client from with src folder before hydration (DD)
  • Instrumentation Client Hook > instrumentationClientInject > runs each injected entry before the user instrumentation-client and before hydration, in array order (DD)
  • Instrumentation Client Hook > instrumentationClientInject > still surfaces onRouterTransitionStart from the user instrumentation-client when injects are configured (DD)
  • Instrumentation Client Hook > onRouterTransitionStart > onRouterTransitionStart fires at the start of a navigation (DD)
  • Instrumentation Client Hook > onRouterTransitionStart > onRouterTransitionStart fires at the start of a back/forward navigation (DD)
Expand output

● Instrumentation Client Hook › With src folder › should execute instrumentation-client from with src folder before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › App Router › should execute instrumentation-client from app router before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › Pages Router › should execute instrumentation-client from pages router before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › onRouterTransitionStart › onRouterTransitionStart fires at the start of a navigation

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

- Expected  - 4
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page",
-   "[Router Transition Start] [push] /",
- ]
+ Array []

  76 |       await browser.elementById('home')
  77 |
> 78 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
     |                                                              ^
  79 |         '[Router Transition Start] [push] /some-page',
  80 |         '[Router Transition Start] [push] /',
  81 |       ])

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:78:62)

● Instrumentation Client Hook › onRouterTransitionStart › onRouterTransitionStart fires at the start of a back/forward navigation

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

- Expected  - 5
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page",
-   "[Router Transition Start] [traverse] /",
-   "[Router Transition Start] [traverse] /some-page",
- ]
+ Array []

   95 |       await browser.elementById('some-page')
   96 |
>  97 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
      |                                                              ^
   98 |         '[Router Transition Start] [push] /some-page',
   99 |         '[Router Transition Start] [traverse] /',
  100 |         '[Router Transition Start] [traverse] /some-page',

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:97:62)

● Instrumentation Client Hook › instrumentationClientInject › runs each injected entry before the user instrumentation-client and before hydration, in array order

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

Expected: ["a", "b", "user"]
Received: undefined

  112 |
  113 |       const order = await browser.eval(`window.__INJECT_ORDER`)
> 114 |       expect(order).toEqual(['a', 'b', 'user'])
      |                     ^
  115 |
  116 |       const injectA = await browser.eval(`window.__INJECT_A_EXECUTED_AT`)
  117 |       const injectB = await browser.eval(`window.__INJECT_B_EXECUTED_AT`)

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:114:21)

● Instrumentation Client Hook › instrumentationClientInject › still surfaces onRouterTransitionStart from the user instrumentation-client when injects are configured

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

- Expected  - 8
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page a",
-   "[Router Transition Start] [push] /some-page b",
-   "[Router Transition Start] [push] /some-page user",
-   "[Router Transition Start] [push] / a",
-   "[Router Transition Start] [push] / b",
-   "[Router Transition Start] [push] / user",
- ]
+ Array []

  142 |       await browser.elementById('home')
  143 |
> 144 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
      |                                                              ^
  145 |         '[Router Transition Start] [push] /some-page a',
  146 |         '[Router Transition Start] [push] /some-page b',
  147 |         '[Router Transition Start] [push] /some-page user',

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:144:62)

● Instrumentation Client Hook › HMR in development mode › should reload instrumentation-client when modified

expect(received).toBeDefined()

Received: undefined

  164 |           `window.__INSTRUMENTATION_CLIENT_EXECUTED_AT`
  165 |         )
> 166 |         expect(initialTime).toBeDefined()
      |                             ^
  167 |
  168 |         // Modify the instrumentation-client.ts file
  169 |         const instrumentationPath = 'instrumentation-client.ts'

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:166:29)

pnpm test-dev test/development/app-dir/react-performance-track/react-performance-track.test.ts (job)

  • react-performance-track > should show setTimeout (DD)
  • react-performance-track > should show fetch (DD)
  • react-performance-track > should show params (DD)
  • react-performance-track > should show searchParams (DD)
  • react-performance-track > should show cookies (DD)
  • react-performance-track > should show draftMode (DD)
  • react-performance-track > should show headers (DD)
Expand output

● react-performance-track › should show setTimeout

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('[data-react-server-requests-done]')

  545 |
  546 |     return this.startChain(async () => {
> 547 |       const el = await page.waitForSelector(selector, {
      |                             ^
  548 |         timeout,
  549 |         state,
  550 |       })

  at waitForSelector (lib/browsers/playwright.ts:547:29)
  at Playwright._chain (lib/browsers/playwright.ts:677:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:658:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:546:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:431:17)
  at Object.elementByCss (development/app-dir/react-performance-track/react-performance-track.test.ts:18:19)

● react-performance-track › should show fetch

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('[data-react-server-requests-done]')

  545 |
  546 |     return this.startChain(async () => {
> 547 |       const el = await page.waitForSelector(selector, {
      |                             ^
  548 |         timeout,
  549 |         state,
  550 |       })

  at waitForSelector (lib/browsers/playwright.ts:547:29)
  at Playwright._chain (lib/browsers/playwright.ts:677:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:658:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:546:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:431:17)
  at Object.elementByCss (development/app-dir/react-performance-track/react-performance-track.test.ts:33:19)

● react-performance-track › should show params

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('[data-react-server-requests-done]')

  545 |
  546 |     return this.startChain(async () => {
> 547 |       const el = await page.waitForSelector(selector, {
      |                             ^
  548 |         timeout,
  549 |         state,
  550 |       })

  at waitForSelector (lib/browsers/playwright.ts:547:29)
  at Playwright._chain (lib/browsers/playwright.ts:677:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:658:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:546:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:431:17)
  at Object.elementByCss (development/app-dir/react-performance-track/react-performance-track.test.ts:55:19)

● react-performance-track › should show searchParams

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('[data-react-server-requests-done]')

  545 |
  546 |     return this.startChain(async () => {
> 547 |       const el = await page.waitForSelector(selector, {
      |                             ^
  548 |         timeout,
  549 |         state,
  550 |       })

  at waitForSelector (lib/browsers/playwright.ts:547:29)
  at Playwright._chain (lib/browsers/playwright.ts:677:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:658:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:546:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:431:17)
  at Object.elementByCss (development/app-dir/react-performance-track/react-performance-track.test.ts:74:19)

● react-performance-track › should show cookies

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('[data-react-server-requests-done]')

  545 |
  546 |     return this.startChain(async () => {
> 547 |       const el = await page.waitForSelector(selector, {
      |                             ^
  548 |         timeout,
  549 |         state,
  550 |       })

  at waitForSelector (lib/browsers/playwright.ts:547:29)
  at Playwright._chain (lib/browsers/playwright.ts:677:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:658:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:546:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:431:17)
  at Object.elementByCss (development/app-dir/react-performance-track/react-performance-track.test.ts:91:19)

● react-performance-track › should show draftMode

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('[data-react-server-requests-done]')

  545 |
  546 |     return this.startChain(async () => {
> 547 |       const el = await page.waitForSelector(selector, {
      |                             ^
  548 |         timeout,
  549 |         state,
  550 |       })

  at waitForSelector (lib/browsers/playwright.ts:547:29)
  at Playwright._chain (lib/browsers/playwright.ts:677:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:658:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:546:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:431:17)
  at Object.elementByCss (development/app-dir/react-performance-track/react-performance-track.test.ts:108:19)

● react-performance-track › should show headers

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('[data-react-server-requests-done]')

  545 |
  546 |     return this.startChain(async () => {
> 547 |       const el = await page.waitForSelector(selector, {
      |                             ^
  548 |         timeout,
  549 |         state,
  550 |       })

  at waitForSelector (lib/browsers/playwright.ts:547:29)
  at Playwright._chain (lib/browsers/playwright.ts:677:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:658:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:546:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:431:17)
  at Object.elementByCss (development/app-dir/react-performance-track/react-performance-track.test.ts:137:19)

pnpm test-dev test/e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts (job)

  • Instrumentation Client Hook > App Router > should execute instrumentation-client from app router before hydration (DD)
  • Instrumentation Client Hook > HMR in development mode > should reload instrumentation-client when modified (DD)
  • Instrumentation Client Hook > Pages Router > should execute instrumentation-client from pages router before hydration (DD)
  • Instrumentation Client Hook > With src folder > should execute instrumentation-client from with src folder before hydration (DD)
  • Instrumentation Client Hook > instrumentationClientInject > runs each injected entry before the user instrumentation-client and before hydration, in array order (DD)
  • Instrumentation Client Hook > instrumentationClientInject > still surfaces onRouterTransitionStart from the user instrumentation-client when injects are configured (DD)
  • Instrumentation Client Hook > onRouterTransitionStart > onRouterTransitionStart fires at the start of a navigation (DD)
  • Instrumentation Client Hook > onRouterTransitionStart > onRouterTransitionStart fires at the start of a back/forward navigation (DD)
Expand output

● Instrumentation Client Hook › With src folder › should execute instrumentation-client from with src folder before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › App Router › should execute instrumentation-client from app router before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › Pages Router › should execute instrumentation-client from pages router before hydration

expect(received).toBeDefined()

Received: undefined

  36 |         const hydrationTime = await browser.eval(`window.__NEXT_HYDRATED_AT`)
  37 |
> 38 |         expect(instrumentationTime).toBeDefined()
     |                                     ^
  39 |         expect(hydrationTime).toBeDefined()
  40 |         expect(instrumentationTime).toBeLessThan(hydrationTime)
  41 |         expect(

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:38:37)

● Instrumentation Client Hook › onRouterTransitionStart › onRouterTransitionStart fires at the start of a navigation

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

- Expected  - 4
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page",
-   "[Router Transition Start] [push] /",
- ]
+ Array []

  76 |       await browser.elementById('home')
  77 |
> 78 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
     |                                                              ^
  79 |         '[Router Transition Start] [push] /some-page',
  80 |         '[Router Transition Start] [push] /',
  81 |       ])

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:78:62)

● Instrumentation Client Hook › onRouterTransitionStart › onRouterTransitionStart fires at the start of a back/forward navigation

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

- Expected  - 5
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page",
-   "[Router Transition Start] [traverse] /",
-   "[Router Transition Start] [traverse] /some-page",
- ]
+ Array []

   95 |       await browser.elementById('some-page')
   96 |
>  97 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
      |                                                              ^
   98 |         '[Router Transition Start] [push] /some-page',
   99 |         '[Router Transition Start] [traverse] /',
  100 |         '[Router Transition Start] [traverse] /some-page',

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:97:62)

● Instrumentation Client Hook › instrumentationClientInject › runs each injected entry before the user instrumentation-client and before hydration, in array order

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

Expected: ["a", "b", "user"]
Received: undefined

  112 |
  113 |       const order = await browser.eval(`window.__INJECT_ORDER`)
> 114 |       expect(order).toEqual(['a', 'b', 'user'])
      |                     ^
  115 |
  116 |       const injectA = await browser.eval(`window.__INJECT_A_EXECUTED_AT`)
  117 |       const injectB = await browser.eval(`window.__INJECT_B_EXECUTED_AT`)

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:114:21)

● Instrumentation Client Hook › instrumentationClientInject › still surfaces onRouterTransitionStart from the user instrumentation-client when injects are configured

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

- Expected  - 8
+ Received  + 1

- Array [
-   "[Router Transition Start] [push] /some-page a",
-   "[Router Transition Start] [push] /some-page b",
-   "[Router Transition Start] [push] /some-page user",
-   "[Router Transition Start] [push] / a",
-   "[Router Transition Start] [push] / b",
-   "[Router Transition Start] [push] / user",
- ]
+ Array []

  142 |       await browser.elementById('home')
  143 |
> 144 |       expect(filterNavigationStartLogs(await browser.log())).toEqual([
      |                                                              ^
  145 |         '[Router Transition Start] [push] /some-page a',
  146 |         '[Router Transition Start] [push] /some-page b',
  147 |         '[Router Transition Start] [push] /some-page user',

  at Object.toEqual (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:144:62)

● Instrumentation Client Hook › HMR in development mode › should reload instrumentation-client when modified

expect(received).toBeDefined()

Received: undefined

  164 |           `window.__INSTRUMENTATION_CLIENT_EXECUTED_AT`
  165 |         )
> 166 |         expect(initialTime).toBeDefined()
      |                             ^
  167 |
  168 |         // Modify the instrumentation-client.ts file
  169 |         const instrumentationPath = 'instrumentation-client.ts'

  at Object.toBeDefined (e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts:166:29)

pnpm test-start test/e2e/app-dir/next-config/index.test.ts (job)

  • app dir - next config > should support importing webpack in next.config (DD)
Expand output

● app dir - next config › should support importing webpack in next.config

FetchError: request to http://localhost:45027/ failed, reason: connect ECONNREFUSED 127.0.0.1:45027

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7_encoding@0.1.13/node_modules/node-fetch/lib/index.js:1491:11)

pnpm test-start test/e2e/instrumentation-client-hook/instrumentation-client-hook.test.ts (job)

... truncated to fit in one GitHub comment ...

Comment thread packages/next/src/webpack/build/entries.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant