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

fix(next-config-ts): properly handle ESM #68365

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

Conversation

devjiwonchoi
Copy link
Member

@devjiwonchoi devjiwonchoi commented Jul 31, 2024

Warning

  • This feature is unsupported in Node.js version 19.x.
  • The minimum Node.js version is bumped from 18.18.0 to 18.19.0.

Why?

next.config.ts was restricted to CJS due to a trade-off of require-hooks. This is a blocker for users who need Native ESM modules or syntax like top-level awaits within the config.

How?

Registered a Node.js loader during loading config to resolve the typescript files including the next.config.ts.

Fixes #67765
Fixes #71705

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. tests labels Jul 31, 2024
Copy link
Member Author

devjiwonchoi commented Jul 31, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @devjiwonchoi and the rest of your teammates on Graphite Graphite

@ijjk
Copy link
Member

ijjk commented Jul 31, 2024

Failing test suites

Commit: 5fae289

pnpm test-start test/e2e/app-dir/next-config-ts/config-as-async-function/next-config-mts.test.ts

  • next-config-ts - config as async function (next.config.mts) > should support config as async function (next.config.mts)
Expand output

● next-config-ts - config as async function (next.config.mts) › should support config as async function (next.config.mts)

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.

pnpm test-start test/e2e/app-dir/next-config-ts/config-as-async-function/project-cjs.test.ts

  • next-config-ts - config as async function (project CJS) > should support config as async function
Expand output

● next-config-ts - config as async function (project CJS) › should support config as async function

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.

pnpm test-start test/e2e/app-dir/next-config-ts/config-as-async-function/project-esm.test.ts

  • next-config-ts - config as async function (project ESM) > should support config as async function (project ESM)
Expand output

● next-config-ts - config as async function (project ESM) › should support config as async function (project ESM)

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.

pnpm test-start-turbo test/e2e/app-dir/app-alias/app-alias.test.ts (turbopack)

  • app-dir alias > should handle typescript paths alias correctly
  • app-dir alias > should resolve css imports from outside with src folder presented
  • app-dir alias > should not contain installed react/react-dom version in client chunks
  • app-dir alias > should generate app-build-manifest correctly
Expand output

● app-dir alias › should handle typescript paths alias 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 alias › should resolve css imports from outside with src folder presented

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 alias › should not contain installed react/react-dom version in client chunks

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 alias › should generate app-build-manifest 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)

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

pnpm test-dev-turbo test/development/basic/theme-ui/theme-ui.test.ts (turbopack)

  • theme-ui SWC option > should have theme provided styling
Expand output

● theme-ui SWC option › should have theme provided styling

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

Expected: "rgb(51, 51, 238)"
Received: "rgb(0, 0, 0)"

  13 |     const browser = await next.browser('/')
  14 |     const color = await browser.elementByCss('#hello').getComputedCss('color')
> 15 |     expect(color).toBe('rgb(51, 51, 238)')
     |                   ^
  16 |   })
  17 | })
  18 |

  at Object.toBe (development/basic/theme-ui/theme-ui.test.ts:15:19)

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

pnpm test-start test/e2e/app-dir/app-prefetch-static/app-prefetch-static.test.ts

  • app-prefetch-static > should correctly navigate between static & dynamic pages
Expand output

● app-prefetch-static › should correctly navigate between static & dynamic pages

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.

pnpm test-dev test/development/correct-tsconfig-defaults/index.test.ts

  • correct tsconfig.json defaults > should add moduleResolution when generating tsconfig.json in dev
Expand output

● correct tsconfig.json defaults › should add moduleResolution when generating tsconfig.json in dev

expect(received).toBeFalse()

Expected value to be false:
  false
Received:
  "{}"

  25 |       expect(
  26 |         await next.readFile('tsconfig.json').catch(() => false)
> 27 |       ).toBeFalse()
     |         ^
  28 |
  29 |       await next.start()
  30 |

  at Object.toBeFalse (development/correct-tsconfig-defaults/index.test.ts:27:9)

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

pnpm test-start-turbo test/e2e/app-dir/modularizeimports/modularizeimports.test.ts (turbopack)

  • modularizeImports > should work
  • modularizeImports > should work with MDX
Expand output

● modularizeImports › should work

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)

● modularizeImports › should work with MDX

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.

pnpm test-dev-turbo test/development/acceptance-app/ReactRefreshRequire.test.ts (turbopack)

  • ReactRefreshRequire app > re-runs accepted modules
  • ReactRefreshRequire app > propagates a hot update to closest accepted module
  • ReactRefreshRequire app > propagates hot update to all inverse dependencies
Expand output

● ReactRefreshRequire app › re-runs accepted modules

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

- Expected  - 0
+ Received  + 2

  Array [
+   "init FooV1",
+   "init FooV1",
    "init BarV2",
  ]

  47 |       `window.log.push('init BarV2'); export default function Bar() { return null; };`
  48 |     )
> 49 |     expect(await session.evaluate(() => (window as any).log)).toEqual([
     |                                                               ^
  50 |       'init BarV2',
  51 |     ])
  52 |

  at Object.toEqual (development/acceptance-app/ReactRefreshRequire.test.ts:49:63)

● ReactRefreshRequire app › propagates a hot update to closest accepted module

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

- Expected  - 0
+ Received  + 1

  Array [
    "init FooV1",
+   "init FooV1",
    "init BarV3",
  ]

  120 |     await session.evaluate(() => ((window as any).log = []))
  121 |     await session.patch('./bar.js', `window.log.push('init BarV3');`)
> 122 |     expect(await session.evaluate(() => (window as any).log)).toEqual([
      |                                                               ^
  123 |       // // FIXME: Metro order:
  124 |       // 'init BarV3',
  125 |       // 'init FooV1',

  at Object.toEqual (development/acceptance-app/ReactRefreshRequire.test.ts:122:63)

● ReactRefreshRequire app › propagates hot update to all inverse dependencies

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

- Expected  - 0
+ Received  + 2

  Array [
+   "init MiddleAV1",
+   "init MiddleBV1",
    "init LeafV2",
    "init MiddleAV1",
    "init MiddleBV1",
  ]

  259 |       `log.push('init LeafV2'); export default {};`
  260 |     )
> 261 |     expect(await session.evaluate(() => (window as any).log)).toEqual([
      |                                                               ^
  262 |       'init LeafV2',
  263 |       'init MiddleAV1',
  264 |       'init MiddleBV1',

  at Object.toEqual (development/acceptance-app/ReactRefreshRequire.test.ts:261:63)

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

pnpm test-dev test/e2e/app-dir/next-config-ts/dynamic-import/next-config-mts.test.ts

  • next-config-ts - dynamic import (next.config.mts) > should support dynamic import (next.config.mts)
Expand output

● next-config-ts - dynamic import (next.config.mts) › should support dynamic import (next.config.mts)

Failed to start server after 10000ms, waiting for this log pattern: / ✓ Ready in /

  356 |     return setTimeout(() => {
  357 |       reject(
> 358 |         new Error(
      |         ^
  359 |           `Failed to start server after ${ms}ms, waiting for this log pattern: ${this.serverReadyPattern}`
  360 |         )
  361 |       )

  at Timeout._onTimeout (lib/next-modes/base.ts:358:9)

● Test suite failed to run

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  255 |       next = await createNext(options)
  256 |     })
> 257 |     afterAll(async () => {
      |     ^
  258 |       // Gracefully destroy the instance if `createNext` success.
  259 |       // If next instance is not available, it's likely beforeAll hook failed and unnecessarily throws another error
  260 |       // by attempting to destroy on undefined.

  at afterAll (lib/e2e-utils/index.ts:257:5)
  at e2e/app-dir/next-config-ts/dynamic-import/next-config-mts.test.ts:4:33
  at Object.describe (e2e/app-dir/next-config-ts/dynamic-import/next-config-mts.test.ts:3:1)

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

pnpm test-start-turbo test/e2e/app-dir/next-config-ts/node-api/index.test.ts (turbopack)

  • next-config-ts-node-api > should be able to use Node.js API
Expand output

● next-config-ts-node-api › should be able to use Node.js API

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.

__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/e2e/app-dir/create-root-layout/create-root-layout.test.ts (PPR)

  • app-dir create root layout > page.js > find available dir > create root layout
  • app-dir create root layout > page.js > root layout in app > create root layout
  • app-dir create root layout > page.js > root layout in route group > create root layout
Expand output

● app-dir create root layout › page.js › root layout in app › create root layout

expect(received).toMatch(expected)

Expected substring: "Your page app/route/page.js did not have a root layout. We created app/layout.js for you."
Received string:    " ⚠ Your page app/route/page.js did not have a root layout. We created app/layout.tsx for you.
 ○ Compiling /route ...
 ✓ Compiled /route in 5.5s (534 modules)
 GET /route 200 in 5890ms
"

  43 |               /did not have a root layout/
  44 |             )
> 45 |             expect(stripAnsi(next.cliOutput.slice(outputIndex))).toMatch(
     |                                                                  ^
  46 |               'Your page app/route/page.js did not have a root layout. We created app/layout.js for you.'
  47 |             )
  48 |

  at Object.toMatch (e2e/app-dir/create-root-layout/create-root-layout.test.ts:45:66)

● app-dir create root layout › page.js › root layout in route group › create root layout

expect(received).toInclude(expected)

Expected string to include:
  "Your page app/(group)/page.js did not have a root layout. We created app/(group)/layout.js for you."
Received:
  " ⚠ Your page app/(group)/page.js did not have a root layout. We created app/(group)/layout.tsx for you.
 ○ Compiling / ...
 ✓ Compiled / in 5s (534 modules)
 GET / 200 in 5257ms
"

  90 |               /did not have a root layout/
  91 |             )
> 92 |             expect(stripAnsi(next.cliOutput.slice(outputIndex))).toInclude(
     |                                                                  ^
  93 |               'Your page app/(group)/page.js did not have a root layout. We created app/(group)/layout.js for you.'
  94 |             )
  95 |

  at Object.toInclude (e2e/app-dir/create-root-layout/create-root-layout.test.ts:92:66)

● app-dir create root layout › page.js › find available dir › create root layout

expect(received).toInclude(expected)

Expected string to include:
  "Your page app/(group)/route/second/inner/page.js did not have a root layout. We created app/(group)/route/second/layout.js for you."
Received:
  " ⚠ Your page app/(group)/route/second/inner/page.js did not have a root layout. We created app/(group)/route/second/layout.tsx for you.
 ○ Compiling /route/second/inner ...
 ✓ Compiled /route/second/inner in 4.5s (534 modules)
 GET /route/second/inner 200 in 4695ms
"

  140 |               /did not have a root layout/
  141 |             )
> 142 |             expect(stripAnsi(next.cliOutput.slice(outputIndex))).toInclude(
      |                                                                  ^
  143 |               'Your page app/(group)/route/second/inner/page.js did not have a root layout. We created app/(group)/route/second/layout.js for you.'
  144 |             )
  145 |

  at Object.toInclude (e2e/app-dir/create-root-layout/create-root-layout.test.ts:142:66)

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-start test/e2e/app-dir/next-config-ts/pkg-module/index.test.ts (PPR)

  • next-config-ts-pkg-module > should handle ESM modules in CommonJS project
Expand output

● next-config-ts-pkg-module › should handle ESM modules in CommonJS project

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.

__NEXT_EXPERIMENTAL_PPR=true pnpm test-start test/e2e/app-dir/next-config-ts/top-level-await/index.test.ts (PPR)

  • next-config-ts-top-level-await > should support top-level await
Expand output

● next-config-ts-top-level-await › should support top-level await

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.

pnpm test-dev test/development/basic/legacy-decorators.test.ts

  • Legacy decorators SWC option > should compile with legacy decorators enabled
Expand output

● Legacy decorators SWC option › should compile with legacy decorators enabled

page.waitForSelector: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('#count')

  423 |     return this.chain(() => {
  424 |       return page
> 425 |         .waitForSelector(selector, { timeout, state: 'attached' })
      |          ^
  426 |         .then(async (el) => {
  427 |           // it seems selenium waits longer and tests rely on this behavior
  428 |           // so we wait for the load event fire before returning

  at waitForSelector (lib/browsers/playwright.ts:425:10)

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

pnpm test-dev-turbo test/development/jsconfig-path-reloading/index.test.ts (turbopack)

  • jsconfig-path-reloading > jsconfig > should load with initial paths config correctly
  • jsconfig-path-reloading > jsconfig > should recover from module not found when paths is updated
  • jsconfig-path-reloading > jsconfig > should automatically fast refresh content when path is added without error
  • jsconfig-path-reloading > jsconfig added after starting dev > should load with initial paths config correctly
  • jsconfig-path-reloading > jsconfig added after starting dev > should recover from module not found when paths is updated
  • jsconfig-path-reloading > jsconfig added after starting dev > should automatically fast refresh content when path is added without error
Expand output

● jsconfig-path-reloading › jsconfig › should load with initial paths config correctly

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

Expected substring: "first button"
Received string:    "<!DOCTYPE html><html><head><meta charSet=\"utf-8\" data-next-head=\"\"/><meta name=\"viewport\" content=\"width=device-width\" data-next-head=\"\"/><style data-next-hide-fouc=\"true\">body{display:none}</style><noscript data-next-hide-fouc=\"true\"><style>body{display:block}</style></noscript><noscript data-n-css=\"\"></noscript><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__6595ab._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/db9cd_react-dom_7c8b91._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/node_modules__pnpm_949440._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__f265a1._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__app_5771e1._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__app_6b5ce6._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__d4d44f._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__2e1cf5._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__error_5771e1._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__error_2fe6c7._.js\" defer=\"\"></script><script src=\"/_next/static/development/_ssgManifest.js\" defer=\"\"></script><script src=\"/_next/static/development/_buildManifest.js\" defer=\"\"></script><noscript id=\"__next_css__DO_NOT_USE__\"></noscript></head><body><div id=\"__next\"></div><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"statusCode\":500}},\"page\":\"/_error\",\"query\":{},\"buildId\":\"development\",\"isFallback\":false,\"err\":{\"name\":\"Error\",\"source\":\"server\",\"message\":\"./pages/index.js:1:1\\nModule not found: Can't resolve '@c/button-1'\\n\\u003e 1 | import { Button1 } from '@c/button-1'\\n    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  2 | import { Button2 } from '@mybutton'\\n  3 | import { firstData } from '@lib/first-data'\\n  4 |\\n\\n\\n\\nhttps://nextjs.org/docs/messages/module-not-found\\n\\n\",\"stack\":\"Error: ./pages/index.js:1:1\\nModule not found: Can't resolve '@c/button-1'\\n\\u001b[0m\\u001b[31m\\u001b[1m\\u003e\\u001b[22m\\u001b[39m\\u001b[90m 1 |\\u001b[39m \\u001b[36mimport\\u001b[39m { \\u001b[33mButton1\\u001b[39m } \\u001b[36mfrom\\u001b[39m \\u001b[32m'@c/button-1'\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m   |\\u001b[39m \\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m 2 |\\u001b[39m \\u001b[36mimport\\u001b[39m { \\u001b[33mButton2\\u001b[39m } \\u001b[36mfrom\\u001b[39m \\u001b[32m'@mybutton'\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m 3 |\\u001b[39m \\u001b[36mimport\\u001b[39m { firstData } \\u001b[36mfrom\\u001b[39m \\u001b[32m'@lib/first-data'\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m 4 |\\u001b[39m\\u001b[0m\\n\\n\\n\\nhttps://nextjs.org/docs/messages/module-not-found\\n\\n\\n    at Object.getCompilationErrors (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/hot-reloader-turbopack.js:662:37)\\n    at DevBundlerService.getCompilationError (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/lib/dev-bundler-service.js:41:55)\\n    at DevServer.getCompilationError (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:631:42)\\n    at DevServer.findPageComponents (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:595:43)\\n    at async DevServer.renderErrorToResponseImpl (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/base-server.js:2452:26)\"},\"gip\":true,\"scriptLoader\":[]}</script></body></html>"

  52 |       const html = await renderViaHTTP(next.url, '/')
  53 |       const $ = cheerio.load(html)
> 54 |       expect(html).toContain('first button')
     |                    ^
  55 |       expect(html).toContain('second button')
  56 |       expect($('#first-data').text()).toContain(
  57 |         JSON.stringify({

  at Object.toContain (development/jsconfig-path-reloading/index.test.ts:54:20)

● jsconfig-path-reloading › jsconfig › should recover from module not found when paths is updated

TIMED OUT: success

<head><meta charset="utf-8" data-next-head=""><meta name="viewport" content="width=device-width" data-next-head=""><noscript data-n-css=""></noscript><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__6595ab._.js" defer=""></script><script src="/_next/static/chunks/db9cd_react-dom_7c8b91._.js" defer=""></script><script src="/_next/static/chunks/node_modules__pnpm_949440._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__f265a1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_6b5ce6._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__d4d44f._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__2e1cf5._.js" defer=""></script><script src="/_next/static/chunks/pages__error_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__error_2fe6c7._.js" defer=""></script><script src="/_next/static/development/_ssgManifest.js" defer=""></script><script src="/_next/static/development/_buildManifest.js" defer=""></script><noscript id="__next_css__DO_NOT_USE__"></noscript></head><body style="overflow: hidden;"><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"development","isFallback":false,"err":{"name":"Error","source":"server","message":"./pages/index.js:1:1\nModule not found: Can't resolve '@c/button-1'\n\u003e 1 | import { Button1 } from '@c/button-1'\n    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  2 | import { Button2 } from '@mybutton'\n  3 | import { firstData } from '@lib/first-data'\n  4 |\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n","stack":"Error: ./pages/index.js:1:1\nModule not found: Can't resolve '@c/button-1'\n\u001b[0m\u001b[31m\u001b[1m\u003e\u001b[22m\u001b[39m\u001b[90m 1 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton1\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@c/button-1'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m   |\u001b[39m \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 2 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton2\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@mybutton'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 3 |\u001b[39m \u001b[36mimport\u001b[39m { firstData } \u001b[36mfrom\u001b[39m \u001b[32m'@lib/first-data'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 4 |\u001b[39m\u001b[0m\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n\n    at Object.getCompilationErrors (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/hot-reloader-turbopack.js:662:37)\n    at DevBundlerService.getCompilationError (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/lib/dev-bundler-service.js:41:55)\n    at DevServer.getCompilationError (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:631:42)\n    at DevServer.findPageComponents (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:595:43)\n    at async DevServer.renderErrorToResponseImpl (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/base-server.js:2452:26)"},"gip":true,"scriptLoader":[]}</script><div id="__next-build-watcher" style="position: fixed; bottom: 10px; right: 20px; width: 0px; height: 0px; z-index: 99999;"></div><next-route-announcer><p aria-live="assertive" id="__next-route-announcer__" role="alert" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; top: 0px; width: 1px; white-space: nowrap; overflow-wrap: normal;"></p></next-route-announcer><nextjs-portal></nextjs-portal></body>

undefined

  718 |
  719 |   if (hardError) {
> 720 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content + '\n\n' + lastErr)
      |           ^
  721 |   }
  722 |   return false
  723 | }

  at check (lib/next-test-utils.ts:720:11)
  at Object.<anonymous> (development/jsconfig-path-reloading/index.test.ts:116:9)

● jsconfig-path-reloading › jsconfig › should automatically fast refresh content when path is added without error

TIMED OUT: success

<head><meta charset="utf-8" data-next-head=""><meta name="viewport" content="width=device-width" data-next-head=""><noscript data-n-css=""></noscript><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__6595ab._.js" defer=""></script><script src="/_next/static/chunks/db9cd_react-dom_7c8b91._.js" defer=""></script><script src="/_next/static/chunks/node_modules__pnpm_949440._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__f265a1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_6b5ce6._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__d4d44f._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__2e1cf5._.js" defer=""></script><script src="/_next/static/chunks/pages__error_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__error_2fe6c7._.js" defer=""></script><script src="/_next/static/development/_ssgManifest.js" defer=""></script><script src="/_next/static/development/_buildManifest.js" defer=""></script><noscript id="__next_css__DO_NOT_USE__"></noscript></head><body style="overflow: hidden;"><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"development","isFallback":false,"err":{"name":"Error","source":"server","message":"./pages/index.js:1:1\nModule not found: Can't resolve '@c/button-1'\n\u003e 1 | import { Button1 } from '@c/button-1'\n    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  2 | import { Button2 } from '@mybutton'\n  3 | import { firstData } from '@lib/first-data'\n  4 |\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n","stack":"Error: ./pages/index.js:1:1\nModule not found: Can't resolve '@c/button-1'\n\u001b[0m\u001b[31m\u001b[1m\u003e\u001b[22m\u001b[39m\u001b[90m 1 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton1\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@c/button-1'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m   |\u001b[39m \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 2 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton2\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@mybutton'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 3 |\u001b[39m \u001b[36mimport\u001b[39m { firstData } \u001b[36mfrom\u001b[39m \u001b[32m'@lib/first-data'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 4 |\u001b[39m\u001b[0m\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n\n    at Object.getCompilationErrors (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/hot-reloader-turbopack.js:662:37)\n    at DevBundlerService.getCompilationError (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/lib/dev-bundler-service.js:41:55)\n    at DevServer.getCompilationError (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:631:42)\n    at DevServer.findPageComponents (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:595:43)\n    at async DevServer.renderErrorToResponseImpl (/tmp/next-install-246a407affea593b7bcd7b5dd803ad2ce85bd6df5de1cb2d90c481deb6250470/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/base-server.js:2452:26)"},"gip":true,"scriptLoader":[]}</script><div id="__next-build-watcher" style="position: fixed; bottom: 10px; right: 20px; width: 0px; height: 0px; z-index: 99999;"></div><next-route-announcer><p aria-live="assertive" id="__next-route-announcer__" role="alert" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; top: 0px; width: 1px; white-space: nowrap; overflow-wrap: normal;"></p></next-route-announcer><nextjs-portal></nextjs-portal></body>

undefined

  718 |
  719 |   if (hardError) {
> 720 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content + '\n\n' + lastErr)
      |           ^
  721 |   }
  722 |   return false
  723 | }

  at check (lib/next-test-utils.ts:720:11)
  at Object.<anonymous> (development/jsconfig-path-reloading/index.test.ts:174:9)

● jsconfig-path-reloading › jsconfig added after starting dev › should load with initial paths config correctly

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

Expected substring: "first button"
Received string:    "<!DOCTYPE html><html><head><meta charSet=\"utf-8\" data-next-head=\"\"/><meta name=\"viewport\" content=\"width=device-width\" data-next-head=\"\"/><style data-next-hide-fouc=\"true\">body{display:none}</style><noscript data-next-hide-fouc=\"true\"><style>body{display:block}</style></noscript><noscript data-n-css=\"\"></noscript><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__6595ab._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/db9cd_react-dom_7c8b91._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/node_modules__pnpm_949440._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__f265a1._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__app_5771e1._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__app_6b5ce6._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__d4d44f._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__2e1cf5._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__error_5771e1._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__error_2fe6c7._.js\" defer=\"\"></script><script src=\"/_next/static/development/_ssgManifest.js\" defer=\"\"></script><script src=\"/_next/static/development/_buildManifest.js\" defer=\"\"></script><noscript id=\"__next_css__DO_NOT_USE__\"></noscript></head><body><div id=\"__next\"></div><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"statusCode\":500}},\"page\":\"/_error\",\"query\":{},\"buildId\":\"development\",\"isFallback\":false,\"err\":{\"name\":\"Error\",\"source\":\"server\",\"message\":\"./pages/index.js:1:1\\nModule not found: Can't resolve '@c/button-1'\\n\\u003e 1 | import { Button1 } from '@c/button-1'\\n    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  2 | import { Button2 } from '@mybutton'\\n  3 | import { firstData } from '@lib/first-data'\\n  4 |\\n\\n\\n\\nhttps://nextjs.org/docs/messages/module-not-found\\n\\n\",\"stack\":\"Error: ./pages/index.js:1:1\\nModule not found: Can't resolve '@c/button-1'\\n\\u001b[0m\\u001b[31m\\u001b[1m\\u003e\\u001b[22m\\u001b[39m\\u001b[90m 1 |\\u001b[39m \\u001b[36mimport\\u001b[39m { \\u001b[33mButton1\\u001b[39m } \\u001b[36mfrom\\u001b[39m \\u001b[32m'@c/button-1'\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m   |\\u001b[39m \\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m 2 |\\u001b[39m \\u001b[36mimport\\u001b[39m { \\u001b[33mButton2\\u001b[39m } \\u001b[36mfrom\\u001b[39m \\u001b[32m'@mybutton'\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m 3 |\\u001b[39m \\u001b[36mimport\\u001b[39m { firstData } \\u001b[36mfrom\\u001b[39m \\u001b[32m'@lib/first-data'\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m 4 |\\u001b[39m\\u001b[0m\\n\\n\\n\\nhttps://nextjs.org/docs/messages/module-not-found\\n\\n\\n    at Object.getCompilationErrors (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/hot-reloader-turbopack.js:662:37)\\n    at DevBundlerService.getCompilationError (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/lib/dev-bundler-service.js:41:55)\\n    at DevServer.getCompilationError (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:631:42)\\n    at DevServer.findPageComponents (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:595:43)\\n    at async DevServer.renderErrorToResponseImpl (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/base-server.js:2452:26)\"},\"gip\":true,\"scriptLoader\":[]}</script></body></html>"

  52 |       const html = await renderViaHTTP(next.url, '/')
  53 |       const $ = cheerio.load(html)
> 54 |       expect(html).toContain('first button')
     |                    ^
  55 |       expect(html).toContain('second button')
  56 |       expect($('#first-data').text()).toContain(
  57 |         JSON.stringify({

  at Object.toContain (development/jsconfig-path-reloading/index.test.ts:54:20)

● jsconfig-path-reloading › jsconfig added after starting dev › should recover from module not found when paths is updated

TIMED OUT: success

<head><meta charset="utf-8" data-next-head=""><meta name="viewport" content="width=device-width" data-next-head=""><noscript data-n-css=""></noscript><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__6595ab._.js" defer=""></script><script src="/_next/static/chunks/db9cd_react-dom_7c8b91._.js" defer=""></script><script src="/_next/static/chunks/node_modules__pnpm_949440._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__f265a1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_6b5ce6._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__d4d44f._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__2e1cf5._.js" defer=""></script><script src="/_next/static/chunks/pages__error_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__error_2fe6c7._.js" defer=""></script><script src="/_next/static/development/_ssgManifest.js" defer=""></script><script src="/_next/static/development/_buildManifest.js" defer=""></script><noscript id="__next_css__DO_NOT_USE__"></noscript></head><body style="overflow: hidden;"><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"development","isFallback":false,"err":{"name":"Error","source":"server","message":"./pages/index.js:1:1\nModule not found: Can't resolve '@c/button-1'\n\u003e 1 | import { Button1 } from '@c/button-1'\n    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  2 | import { Button2 } from '@mybutton'\n  3 | import { firstData } from '@lib/first-data'\n  4 |\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n","stack":"Error: ./pages/index.js:1:1\nModule not found: Can't resolve '@c/button-1'\n\u001b[0m\u001b[31m\u001b[1m\u003e\u001b[22m\u001b[39m\u001b[90m 1 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton1\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@c/button-1'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m   |\u001b[39m \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 2 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton2\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@mybutton'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 3 |\u001b[39m \u001b[36mimport\u001b[39m { firstData } \u001b[36mfrom\u001b[39m \u001b[32m'@lib/first-data'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 4 |\u001b[39m\u001b[0m\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n\n    at Object.getCompilationErrors (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/hot-reloader-turbopack.js:662:37)\n    at DevBundlerService.getCompilationError (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/lib/dev-bundler-service.js:41:55)\n    at DevServer.getCompilationError (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:631:42)\n    at DevServer.findPageComponents (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:595:43)\n    at async DevServer.renderErrorToResponseImpl (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/base-server.js:2452:26)"},"gip":true,"scriptLoader":[]}</script><div id="__next-build-watcher" style="position: fixed; bottom: 10px; right: 20px; width: 0px; height: 0px; z-index: 99999;"></div><next-route-announcer><p aria-live="assertive" id="__next-route-announcer__" role="alert" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; top: 0px; width: 1px; white-space: nowrap; overflow-wrap: normal;"></p></next-route-announcer><nextjs-portal></nextjs-portal></body>

undefined

  718 |
  719 |   if (hardError) {
> 720 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content + '\n\n' + lastErr)
      |           ^
  721 |   }
  722 |   return false
  723 | }

  at check (lib/next-test-utils.ts:720:11)
  at Object.<anonymous> (development/jsconfig-path-reloading/index.test.ts:116:9)

● jsconfig-path-reloading › jsconfig added after starting dev › should automatically fast refresh content when path is added without error

TIMED OUT: success

<head><meta charset="utf-8" data-next-head=""><meta name="viewport" content="width=device-width" data-next-head=""><noscript data-n-css=""></noscript><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__6595ab._.js" defer=""></script><script src="/_next/static/chunks/db9cd_react-dom_7c8b91._.js" defer=""></script><script src="/_next/static/chunks/node_modules__pnpm_949440._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__f265a1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_6b5ce6._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__d4d44f._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__2e1cf5._.js" defer=""></script><script src="/_next/static/chunks/pages__error_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__error_2fe6c7._.js" defer=""></script><script src="/_next/static/development/_ssgManifest.js" defer=""></script><script src="/_next/static/development/_buildManifest.js" defer=""></script><noscript id="__next_css__DO_NOT_USE__"></noscript></head><body style="overflow: hidden;"><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"development","isFallback":false,"err":{"name":"Error","source":"server","message":"./pages/index.js:1:1\nModule not found: Can't resolve '@c/button-1'\n\u003e 1 | import { Button1 } from '@c/button-1'\n    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  2 | import { Button2 } from '@mybutton'\n  3 | import { firstData } from '@lib/first-data'\n  4 |\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n","stack":"Error: ./pages/index.js:1:1\nModule not found: Can't resolve '@c/button-1'\n\u001b[0m\u001b[31m\u001b[1m\u003e\u001b[22m\u001b[39m\u001b[90m 1 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton1\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@c/button-1'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m   |\u001b[39m \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 2 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton2\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@mybutton'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 3 |\u001b[39m \u001b[36mimport\u001b[39m { firstData } \u001b[36mfrom\u001b[39m \u001b[32m'@lib/first-data'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 4 |\u001b[39m\u001b[0m\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n\n    at Object.getCompilationErrors (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/hot-reloader-turbopack.js:662:37)\n    at DevBundlerService.getCompilationError (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/lib/dev-bundler-service.js:41:55)\n    at DevServer.getCompilationError (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:631:42)\n    at DevServer.findPageComponents (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/dev/next-dev-server.js:595:43)\n    at async DevServer.renderErrorToResponseImpl (/tmp/next-install-07a93d80b1e94a0cb58c0624bf3faccb1f2aa4628be6c126b00ba91f06f334b4/node_modules/.pnpm/file+..+next-repo-d80788ea35de05707526b6a0bc4cf0bdb32637b2325791863701f9f8bed7af81+packages+n_nscukcfyistholuihj2rjdfwiy/node_modules/next/dist/server/base-server.js:2452:26)"},"gip":true,"scriptLoader":[]}</script><div id="__next-build-watcher" style="position: fixed; bottom: 10px; right: 20px; width: 0px; height: 0px; z-index: 99999;"></div><next-route-announcer><p aria-live="assertive" id="__next-route-announcer__" role="alert" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; top: 0px; width: 1px; white-space: nowrap; overflow-wrap: normal;"></p></next-route-announcer><nextjs-portal></nextjs-portal></body>

undefined

  718 |
  719 |   if (hardError) {
> 720 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content + '\n\n' + lastErr)
      |           ^
  721 |   }
  722 |   return false
  723 | }

  at check (lib/next-test-utils.ts:720:11)
  at Object.<anonymous> (development/jsconfig-path-reloading/index.test.ts:174:9)

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

pnpm test-dev-turbo test/development/tsconfig-path-reloading/index.test.ts (turbopack)

  • tsconfig-path-reloading > tsconfig > should load with initial paths config correctly
  • tsconfig-path-reloading > tsconfig > should recover from module not found when paths is updated
  • tsconfig-path-reloading > tsconfig > should automatically fast refresh content when path is added without error
Expand output

● tsconfig-path-reloading › tsconfig › should load with initial paths config correctly

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

Expected substring: "first button"
Received string:    "<!DOCTYPE html><html><head><meta charSet=\"utf-8\" data-next-head=\"\"/><meta name=\"viewport\" content=\"width=device-width\" data-next-head=\"\"/><style data-next-hide-fouc=\"true\">body{display:none}</style><noscript data-next-hide-fouc=\"true\"><style>body{display:block}</style></noscript><noscript data-n-css=\"\"></noscript><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__e476b0._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/db9cd_react-dom_7c8b91._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/node_modules__pnpm_949440._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__f265a1._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__app_5771e1._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__app_542cf2._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__6da0bb._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/%5Broot%20of%20the%20server%5D__2e1cf5._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__error_5771e1._.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages__error_ddfb13._.js\" defer=\"\"></script><script src=\"/_next/static/development/_ssgManifest.js\" defer=\"\"></script><script src=\"/_next/static/development/_buildManifest.js\" defer=\"\"></script><noscript id=\"__next_css__DO_NOT_USE__\"></noscript></head><body><div id=\"__next\"></div><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"statusCode\":500}},\"page\":\"/_error\",\"query\":{},\"buildId\":\"development\",\"isFallback\":false,\"err\":{\"name\":\"Error\",\"source\":\"server\",\"message\":\"./pages/index.tsx:1:1\\nModule not found: Can't resolve '@c/button-1'\\n\\u003e 1 | import { Button1 } from '@c/button-1'\\n    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  2 | import { Button2 } from '@mybutton'\\n  3 | import { firstData } from '@lib/first-data'\\n  4 |\\n\\n\\n\\nhttps://nextjs.org/docs/messages/module-not-found\\n\\n\",\"stack\":\"Error: ./pages/index.tsx:1:1\\nModule not found: Can't resolve '@c/button-1'\\n\\u001b[0m\\u001b[31m\\u001b[1m\\u003e\\u001b[22m\\u001b[39m\\u001b[90m 1 |\\u001b[39m \\u001b[36mimport\\u001b[39m { \\u001b[33mButton1\\u001b[39m } \\u001b[36mfrom\\u001b[39m \\u001b[32m'@c/button-1'\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m   |\\u001b[39m \\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[31m\\u001b[1m^\\u001b[22m\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m 2 |\\u001b[39m \\u001b[36mimport\\u001b[39m { \\u001b[33mButton2\\u001b[39m } \\u001b[36mfrom\\u001b[39m \\u001b[32m'@mybutton'\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m 3 |\\u001b[39m \\u001b[36mimport\\u001b[39m { firstData } \\u001b[36mfrom\\u001b[39m \\u001b[32m'@lib/first-data'\\u001b[39m\\u001b[0m\\n\\u001b[0m \\u001b[90m 4 |\\u001b[39m\\u001b[0m\\n\\n\\n\\nhttps://nextjs.org/docs/messages/module-not-found\\n\\n\\n    at Object.getCompilationErrors (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/dev/hot-reloader-turbopack.js:662:37)\\n    at DevBundlerService.getCompilationError (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/lib/dev-bundler-service.js:41:55)\\n    at DevServer.getCompilationError (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/dev/next-dev-server.js:631:42)\\n    at DevServer.findPageComponents (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/dev/next-dev-server.js:595:43)\\n    at async DevServer.renderErrorToResponseImpl (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/base-server.js:2452:26)\"},\"gip\":true,\"scriptLoader\":[]}</script></body></html>"

  52 |       const html = await renderViaHTTP(next.url, '/')
  53 |       const $ = cheerio.load(html)
> 54 |       expect(html).toContain('first button')
     |                    ^
  55 |       expect(html).toContain('second button')
  56 |       expect($('#first-data').text()).toContain(
  57 |         JSON.stringify({

  at Object.toContain (development/tsconfig-path-reloading/index.test.ts:54:20)

● tsconfig-path-reloading › tsconfig › should recover from module not found when paths is updated

TIMED OUT: success

<head><meta charset="utf-8" data-next-head=""><meta name="viewport" content="width=device-width" data-next-head=""><noscript data-n-css=""></noscript><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__e476b0._.js" defer=""></script><script src="/_next/static/chunks/db9cd_react-dom_7c8b91._.js" defer=""></script><script src="/_next/static/chunks/node_modules__pnpm_949440._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__f265a1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_542cf2._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__6da0bb._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__2e1cf5._.js" defer=""></script><script src="/_next/static/chunks/pages__error_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__error_ddfb13._.js" defer=""></script><script src="/_next/static/development/_ssgManifest.js" defer=""></script><script src="/_next/static/development/_buildManifest.js" defer=""></script><noscript id="__next_css__DO_NOT_USE__"></noscript></head><body style="overflow: hidden;"><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"development","isFallback":false,"err":{"name":"Error","source":"server","message":"./pages/index.tsx:1:1\nModule not found: Can't resolve '@c/button-1'\n\u003e 1 | import { Button1 } from '@c/button-1'\n    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  2 | import { Button2 } from '@mybutton'\n  3 | import { firstData } from '@lib/first-data'\n  4 |\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n","stack":"Error: ./pages/index.tsx:1:1\nModule not found: Can't resolve '@c/button-1'\n\u001b[0m\u001b[31m\u001b[1m\u003e\u001b[22m\u001b[39m\u001b[90m 1 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton1\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@c/button-1'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m   |\u001b[39m \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 2 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton2\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@mybutton'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 3 |\u001b[39m \u001b[36mimport\u001b[39m { firstData } \u001b[36mfrom\u001b[39m \u001b[32m'@lib/first-data'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 4 |\u001b[39m\u001b[0m\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n\n    at Object.getCompilationErrors (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/dev/hot-reloader-turbopack.js:662:37)\n    at DevBundlerService.getCompilationError (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/lib/dev-bundler-service.js:41:55)\n    at DevServer.getCompilationError (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/dev/next-dev-server.js:631:42)\n    at DevServer.findPageComponents (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/dev/next-dev-server.js:595:43)\n    at async DevServer.renderErrorToResponseImpl (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/base-server.js:2452:26)"},"gip":true,"scriptLoader":[]}</script><div id="__next-build-watcher" style="position: fixed; bottom: 10px; right: 20px; width: 0px; height: 0px; z-index: 99999;"></div><next-route-announcer><p aria-live="assertive" id="__next-route-announcer__" role="alert" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; top: 0px; width: 1px; white-space: nowrap; overflow-wrap: normal;"></p></next-route-announcer><nextjs-portal></nextjs-portal></body>

undefined

  718 |
  719 |   if (hardError) {
> 720 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content + '\n\n' + lastErr)
      |           ^
  721 |   }
  722 |   return false
  723 | }

  at check (lib/next-test-utils.ts:720:11)
  at Object.<anonymous> (development/tsconfig-path-reloading/index.test.ts:116:9)

● tsconfig-path-reloading › tsconfig › should automatically fast refresh content when path is added without error

TIMED OUT: success

<head><meta charset="utf-8" data-next-head=""><meta name="viewport" content="width=device-width" data-next-head=""><noscript data-n-css=""></noscript><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__e476b0._.js" defer=""></script><script src="/_next/static/chunks/db9cd_react-dom_7c8b91._.js" defer=""></script><script src="/_next/static/chunks/node_modules__pnpm_949440._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__f265a1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__app_542cf2._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__6da0bb._.js" defer=""></script><script src="/_next/static/chunks/%5Broot%20of%20the%20server%5D__2e1cf5._.js" defer=""></script><script src="/_next/static/chunks/pages__error_5771e1._.js" defer=""></script><script src="/_next/static/chunks/pages__error_ddfb13._.js" defer=""></script><script src="/_next/static/development/_ssgManifest.js" defer=""></script><script src="/_next/static/development/_buildManifest.js" defer=""></script><noscript id="__next_css__DO_NOT_USE__"></noscript></head><body style="overflow: hidden;"><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"development","isFallback":false,"err":{"name":"Error","source":"server","message":"./pages/index.tsx:1:1\nModule not found: Can't resolve '@c/button-1'\n\u003e 1 | import { Button1 } from '@c/button-1'\n    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  2 | import { Button2 } from '@mybutton'\n  3 | import { firstData } from '@lib/first-data'\n  4 |\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n","stack":"Error: ./pages/index.tsx:1:1\nModule not found: Can't resolve '@c/button-1'\n\u001b[0m\u001b[31m\u001b[1m\u003e\u001b[22m\u001b[39m\u001b[90m 1 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton1\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@c/button-1'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m   |\u001b[39m \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 2 |\u001b[39m \u001b[36mimport\u001b[39m { \u001b[33mButton2\u001b[39m } \u001b[36mfrom\u001b[39m \u001b[32m'@mybutton'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 3 |\u001b[39m \u001b[36mimport\u001b[39m { firstData } \u001b[36mfrom\u001b[39m \u001b[32m'@lib/first-data'\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 4 |\u001b[39m\u001b[0m\n\n\n\nhttps://nextjs.org/docs/messages/module-not-found\n\n\n    at Object.getCompilationErrors (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/dev/hot-reloader-turbopack.js:662:37)\n    at DevBundlerService.getCompilationError (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/lib/dev-bundler-service.js:41:55)\n    at DevServer.getCompilationError (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/dev/next-dev-server.js:631:42)\n    at DevServer.findPageComponents (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/dev/next-dev-server.js:595:43)\n    at async DevServer.renderErrorToResponseImpl (/tmp/next-install-901f84c5ca37692fbec1f10bbcc98e9a32a7e028420dbc2190d087cd95361a77/node_modules/.pnpm/next@file+..+next-repo-2ddd4e2f833691d6fede253932aa64ae933058fa216e8911da7604f192164ee0+packa_z3fq6lq67wdytjggqzrjweiaua/node_modules/next/dist/server/base-server.js:2452:26)"},"gip":true,"scriptLoader":[]}</script><div id="__next-build-watcher" style="position: fixed; bottom: 10px; right: 20px; width: 0px; height: 0px; z-index: 99999;"></div><next-route-announcer><p aria-live="assertive" id="__next-route-announcer__" role="alert" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; top: 0px; width: 1px; white-space: nowrap; overflow-wrap: normal;"></p></next-route-announcer><nextjs-portal></nextjs-portal></body>

undefined

  718 |
  719 |   if (hardError) {
> 720 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content + '\n\n' + lastErr)
      |           ^
  721 |   }
  722 |   return false
  723 | }

  at check (lib/next-test-utils.ts:720:11)
  at Object.<anonymous> (development/tsconfig-path-reloading/index.test.ts:174:9)

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

pnpm test-dev-turbo test/e2e/app-dir/next-config-ts/pkg-commonjs/index.test.ts (turbopack)

  • next-config-ts-pkg-commonjs > should handle ESM modules in CommonJS project
Expand output

● next-config-ts-pkg-commonjs › should handle ESM modules in CommonJS project

thrown: "Exceeded timeout of 240000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils/index.ts:254:5)
  at e2e/app-dir/next-config-ts/pkg-commonjs/index.test.ts:4:33
  at Object.describe (e2e/app-dir/next-config-ts/pkg-commonjs/index.test.ts:3:1)

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

@devjiwonchoi devjiwonchoi changed the title test: add dynamic import fix(next-config-ts): properly handle ESM Jul 31, 2024
@ijjk
Copy link
Member

ijjk commented Jul 31, 2024

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary vercel/next.js 08-01-test_add_dynamic_import Change
buildDuration 20.3s 17.5s N/A
buildDurationCached 16.5s 14s N/A
nodeModulesSize 403 MB 403 MB ⚠️ +78.9 kB
nextStartRea..uration (ms) 483ms 485ms N/A
Client Bundles (main, webpack)
vercel/next.js canary vercel/next.js 08-01-test_add_dynamic_import Change
0b69cffb-HASH.js gzip 52.6 kB 52.6 kB N/A
1924.HASH.js gzip 169 B 169 B
195-HASH.js gzip 45.8 kB 45.8 kB N/A
8589-HASH.js gzip 5.28 kB 5.29 kB N/A
framework-HASH.js gzip 57.3 kB 57.3 kB N/A
main-app-HASH.js gzip 231 B 229 B N/A
main-HASH.js gzip 33.3 kB 33.3 kB N/A
webpack-HASH.js gzip 1.71 kB 1.71 kB N/A
Overall change 169 B 169 B
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js 08-01-test_add_dynamic_import Change
polyfills-HASH.js gzip 39.5 kB 39.5 kB
Overall change 39.5 kB 39.5 kB
Client Pages
vercel/next.js canary vercel/next.js 08-01-test_add_dynamic_import Change
_app-HASH.js gzip 193 B 193 B
_error-HASH.js gzip 192 B 190 B N/A
amp-HASH.js gzip 513 B 514 B N/A
css-HASH.js gzip 343 B 342 B N/A
dynamic-HASH.js gzip 1.83 kB 1.83 kB
edge-ssr-HASH.js gzip 266 B 266 B
head-HASH.js gzip 363 B 365 B N/A
hooks-HASH.js gzip 394 B 394 B
image-HASH.js gzip 4.44 kB 4.44 kB N/A
index-HASH.js gzip 268 B 267 B N/A
link-HASH.js gzip 2.78 kB 2.78 kB N/A
routerDirect..HASH.js gzip 328 B 328 B
script-HASH.js gzip 396 B 396 B
withRouter-HASH.js gzip 325 B 322 B N/A
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 3.51 kB 3.51 kB
Client Build Manifests
vercel/next.js canary vercel/next.js 08-01-test_add_dynamic_import Change
_buildManifest.js gzip 753 B 756 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js 08-01-test_add_dynamic_import Change
index.html gzip 522 B 523 B N/A
link.html gzip 538 B 537 B N/A
withRouter.html gzip 518 B 518 B
Overall change 518 B 518 B
Edge SSR bundle Size
vercel/next.js canary vercel/next.js 08-01-test_add_dynamic_import Change
edge-ssr.js gzip 128 kB 128 kB N/A
page.js gzip 198 kB 198 kB N/A
Overall change 0 B 0 B
Middleware size
vercel/next.js canary vercel/next.js 08-01-test_add_dynamic_import Change
middleware-b..fest.js gzip 666 B 668 B N/A
middleware-r..fest.js gzip 156 B 154 B N/A
middleware.js gzip 31.1 kB 31.1 kB N/A
edge-runtime..pack.js gzip 848 B 848 B
Overall change 848 B 848 B
Next Runtimes
vercel/next.js canary vercel/next.js 08-01-test_add_dynamic_import Change
196-experime...dev.js gzip 325 B 325 B
196.runtime.dev.js gzip 317 B 317 B
app-page-exp...dev.js gzip 321 kB 321 kB N/A
app-page-exp..prod.js gzip 123 kB 123 kB
app-page-tur..prod.js gzip 136 kB 136 kB
app-page-tur..prod.js gzip 131 kB 131 kB
app-page.run...dev.js gzip 312 kB 312 kB
app-page.run..prod.js gzip 119 kB 119 kB
app-route-ex...dev.js gzip 36.2 kB 36.2 kB
app-route-ex..prod.js gzip 24.5 kB 24.5 kB
app-route-tu..prod.js gzip 24.5 kB 24.5 kB
app-route-tu..prod.js gzip 24.3 kB 24.3 kB
app-route.ru...dev.js gzip 37.8 kB 37.8 kB
app-route.ru..prod.js gzip 24.3 kB 24.3 kB
pages-api-tu..prod.js gzip 9.62 kB 9.62 kB
pages-api.ru...dev.js gzip 11.5 kB 11.5 kB
pages-api.ru..prod.js gzip 9.61 kB 9.61 kB
pages-turbo...prod.js gzip 21 kB 21 kB
pages.runtim...dev.js gzip 26.6 kB 26.6 kB
pages.runtim..prod.js gzip 20.9 kB 20.9 kB
server.runti..prod.js gzip 917 kB 917 kB
Overall change 2.01 MB 2.01 MB
build cache Overall increase ⚠️
vercel/next.js canary vercel/next.js 08-01-test_add_dynamic_import Change
0.pack gzip 2.04 MB 2.03 MB N/A
index.pack gzip 145 kB 145 kB ⚠️ +714 B
Overall change 145 kB 145 kB ⚠️ +714 B
Diff details
Diff for page.js
@@ -15,7 +15,7 @@
       /***/
     },
 
-    /***/ 7150: /***/ (
+    /***/ 2663: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -30,7 +30,7 @@
         default: () => /* binding */ nHandler,
       });
 
-      // NAMESPACE OBJECT: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fapp-edge-ssr%2Fpage&page=%2Fapp-edge-ssr%2Fpage&pagePath=private-next-app-dir%2Fapp-edge-ssr%2Fpage.js&appDir=%2Ftmp%2Fnext-stats1MGSKJ%2Fstats-app%2Fapp&appPaths=%2Fapp-edge-ssr%2Fpage&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=&flyingShuttle=false&preferredRegion=&middlewareConfig=e30%3D!./app/app-edge-ssr/page.js?__next_edge_ssr_entry__
+      // NAMESPACE OBJECT: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fapp-edge-ssr%2Fpage&page=%2Fapp-edge-ssr%2Fpage&pagePath=private-next-app-dir%2Fapp-edge-ssr%2Fpage.js&appDir=%2Ftmp%2Fnext-stats1MGSKJ%2Fstats-app%2Fapp&appPaths=%2Fapp-edge-ssr%2Fpage&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=&flyingShuttle=false&preferredRegion=&middlewareConfig=e30%3D!./app/app-edge-ssr/page.js?__next_edge_ssr_entry__
       var page_next_edge_ssr_entry_namespaceObject = {};
       __webpack_require__.r(page_next_edge_ssr_entry_namespaceObject);
       __webpack_require__.d(page_next_edge_ssr_entry_namespaceObject, {
@@ -84,35 +84,35 @@
         workUnitAsyncStorage: () => entry_base /* workUnitAsyncStorage */.FP,
       });
 
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/server/web/globals.js
-      var globals = __webpack_require__(2951);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/server/web/adapter.js + 3 modules
-      var adapter = __webpack_require__(2203);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/build/webpack/loaders/next-edge-ssr-loader/render.js + 84 modules
-      var render = __webpack_require__(9126);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/server/lib/incremental-cache/index.js + 5 modules
-      var incremental_cache = __webpack_require__(3156);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/server/app-render/app-render.js + 65 modules
-      var app_render = __webpack_require__(3977);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/server/route-modules/app-page/module.compiled.js
-      var module_compiled = __webpack_require__(9453);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/server/route-kind.js
-      var route_kind = __webpack_require__(4858);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/client/components/error-boundary.js
-      var error_boundary = __webpack_require__(4324);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/server/app-render/entry-base.js + 26 modules
-      var entry_base = __webpack_require__(5663); // ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fapp-edge-ssr%2Fpage&page=%2Fapp-edge-ssr%2Fpage&pagePath=private-next-app-dir%2Fapp-edge-ssr%2Fpage.js&appDir=%2Ftmp%2Fnext-stats1MGSKJ%2Fstats-app%2Fapp&appPaths=%2Fapp-edge-ssr%2Fpage&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=&flyingShuttle=false&preferredRegion=&middlewareConfig=e30%3D!./app/app-edge-ssr/page.js?__next_edge_ssr_entry__
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/server/web/globals.js
+      var globals = __webpack_require__(8077);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/server/web/adapter.js + 3 modules
+      var adapter = __webpack_require__(5713);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/build/webpack/loaders/next-edge-ssr-loader/render.js + 84 modules
+      var render = __webpack_require__(3108);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/server/lib/incremental-cache/index.js + 5 modules
+      var incremental_cache = __webpack_require__(1102);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/server/app-render/app-render.js + 65 modules
+      var app_render = __webpack_require__(803);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/server/route-modules/app-page/module.compiled.js
+      var module_compiled = __webpack_require__(3575);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/server/route-kind.js
+      var route_kind = __webpack_require__(1448);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/client/components/error-boundary.js
+      var error_boundary = __webpack_require__(3690);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/server/app-render/entry-base.js + 26 modules
+      var entry_base = __webpack_require__(6325); // ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fapp-edge-ssr%2Fpage&page=%2Fapp-edge-ssr%2Fpage&pagePath=private-next-app-dir%2Fapp-edge-ssr%2Fpage.js&appDir=%2Ftmp%2Fnext-stats1MGSKJ%2Fstats-app%2Fapp&appPaths=%2Fapp-edge-ssr%2Fpage&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=&flyingShuttle=false&preferredRegion=&middlewareConfig=e30%3D!./app/app-edge-ssr/page.js?__next_edge_ssr_entry__
       const module0 = () =>
         Promise.resolve(/* import() eager */).then(
-          __webpack_require__.bind(__webpack_require__, 9469)
+          __webpack_require__.bind(__webpack_require__, 3073)
         );
       const module1 = () =>
         Promise.resolve(/* import() eager */).then(
-          __webpack_require__.bind(__webpack_require__, 4000)
+          __webpack_require__.bind(__webpack_require__, 6342)
         );
       const page2 = () =>
         Promise.resolve(/* import() eager */).then(
-          __webpack_require__.bind(__webpack_require__, 8855)
+          __webpack_require__.bind(__webpack_require__, 1675)
         );
 
       // We inject the tree and pages here so that we can use them in the route
@@ -175,12 +175,12 @@
       });
 
       //# sourceMappingURL=app-page.js.map
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/lib/page-types.js
-      var page_types = __webpack_require__(5365);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/server/app-render/encryption-utils.js
-      var encryption_utils = __webpack_require__(9284);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/esm/server/app-render/action-utils.js
-      var action_utils = __webpack_require__(3095); // ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/dist/build/webpack/loaders/next-edge-ssr-loader/index.js?{"absolute500Path":"","absoluteAppPath":"next/dist/pages/_app","absoluteDocumentPath":"next/dist/pages/_document","absoluteErrorPath":"next/dist/pages/_error","absolutePagePath":"private-next-app-dir/app-edge-ssr/page.js","dev":false,"isServerComponent":true,"page":"/app-edge-ssr/page","stringifiedConfig":"eyJlbnYiOnt9LCJlc2xpbnQiOnsiaWdub3JlRHVyaW5nQnVpbGRzIjpmYWxzZX0sInR5cGVzY3JpcHQiOnsiaWdub3JlQnVpbGRFcnJvcnMiOmZhbHNlLCJ0c2NvbmZpZ1BhdGgiOiJ0c2NvbmZpZy5qc29uIn0sImRpc3REaXIiOiIubmV4dCIsImNsZWFuRGlzdERpciI6dHJ1ZSwiYXNzZXRQcmVmaXgiOiIiLCJjYWNoZU1heE1lbW9yeVNpemUiOjUyNDI4ODAwLCJjb25maWdPcmlnaW4iOiJuZXh0LmNvbmZpZy5qcyIsInVzZUZpbGVTeXN0ZW1QdWJsaWNSb3V0ZXMiOnRydWUsImdlbmVyYXRlRXRhZ3MiOnRydWUsInBhZ2VFeHRlbnNpb25zIjpbInRzeCIsInRzIiwianN4IiwianMiXSwicG93ZXJlZEJ5SGVhZGVyIjp0cnVlLCJjb21wcmVzcyI6dHJ1ZSwiaW1hZ2VzIjp7ImRldmljZVNpemVzIjp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0ZW5zaW9ucz1qcyZiYXNlUGF0aD0mYXNzZXRQcmVmaXg9Jm5leHRDb25maWdPdXRwdXQ9JmZseWluZ1NodXR0bGU9ZmFsc2UmcHJlZmVycmVkUmVnaW9uPSZtaWRkbGV3YXJlQ29uZmlnPWUzMCUzRCE=","sriEnabled":false,"middlewareConfig":"e30=","cacheHandlers":"{}"}!
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/lib/page-types.js
+      var page_types = __webpack_require__(1947);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/server/app-render/encryption-utils.js
+      var encryption_utils = __webpack_require__(4830);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/esm/server/app-render/action-utils.js
+      var action_utils = __webpack_require__(7873); // ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/dist/build/webpack/loaders/next-edge-ssr-loader/index.js?{"absolute500Path":"","absoluteAppPath":"next/dist/pages/_app","absoluteDocumentPath":"next/dist/pages/_document","absoluteErrorPath":"next/dist/pages/_error","absolutePagePath":"private-next-app-dir/app-edge-ssr/page.js","dev":false,"isServerComponent":true,"page":"/app-edge-ssr/page","stringifiedConfig":"eyJlbnYiOnt9LCJlc2xpbnQiOnsiaWdub3JlRHVyaW5nQnVpbGRzIjpmYWxzZX0sInR5cGVzY3JpcHQiOnsiaWdub3JlQnVpbGRFcnJvcnMiOmZhbHNlLCJ0c2Nvb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=","pagesType":"app","appDirLoader":"bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBwLWVkZ2Utc3NyJTJGcGFnZSZwYWdlPSUyRmFwcC1lZGdlLXNzciUyRnBhZ2UmcGFnZVBhdGg9cHJpdmF0ZS1uZXh0LWFwcC1kaXIlMkZhcHAtZWRnZS1zc3IlMkZwYWdlLmpzJmFwcERpcj0lMkZ0bXAlMkZuZXh0LXN0YXRzMU1HU0tKJTJGc3RhdHMtYXBwJTJGYXBwJmFwcFBhdGhzPSUyRmFwcC1lZGdlLXNzciUyRnBhZ2UmcGFnZUV4dGVuc2lvbnM9dHN4JnBhZ2VFeHRlbnNpb25zPXRzJnBhZ2VFeHRlbnNpb25zPWpzeCZwYWdlRXh0ZW5zaW9ucz1qcyZiYXNlUGF0aD0mYXNzZXRQcmVmaXg9Jm5leHRDb25maWdPdXRwdXQ9JmZseWluZ1NodXR0bGU9ZmFsc2UmcHJlZmVycmVkUmVnaW9uPSZtaWRkbGV3YXJlQ29uZmlnPWUzMCUzRCE=","sriEnabled":false,"middlewareConfig":"e30=","cacheHandlers":"{}"}!
       var _self___RSC_MANIFEST;
 
       const incrementalCacheHandler = null;
@@ -464,105 +464,105 @@
       /***/
     },
 
-    /***/ 6261: /***/ (
+    /***/ 2383: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
     ) => {
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 2788)
+        __webpack_require__.bind(__webpack_require__, 9102)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 2950)
+        __webpack_require__.bind(__webpack_require__, 4860)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 1472)
+        __webpack_require__.bind(__webpack_require__, 1018)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 4324)
+        __webpack_require__.bind(__webpack_require__, 3690)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 4412)
+        __webpack_require__.bind(__webpack_require__, 5918)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 8207)
+        __webpack_require__.bind(__webpack_require__, 3905)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 4065)
+        __webpack_require__.bind(__webpack_require__, 4283)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 3748)
+        __webpack_require__.bind(__webpack_require__, 4818)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 5718)
+        __webpack_require__.bind(__webpack_require__, 9952)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 9597)
+        __webpack_require__.bind(__webpack_require__, 7955)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 2956)
+        __webpack_require__.bind(__webpack_require__, 7454)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 3622)
+        __webpack_require__.bind(__webpack_require__, 2504)
       );
 
       /***/
     },
 
-    /***/ 9829: /***/ (
+    /***/ 5511: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
     ) => {
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 8929)
+        __webpack_require__.bind(__webpack_require__, 4251)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 4946)
+        __webpack_require__.bind(__webpack_require__, 8808)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 6556)
+        __webpack_require__.bind(__webpack_require__, 4918)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 7216)
+        __webpack_require__.bind(__webpack_require__, 8902)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 2400)
+        __webpack_require__.bind(__webpack_require__, 4722)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 9547)
+        __webpack_require__.bind(__webpack_require__, 9961)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 4173)
+        __webpack_require__.bind(__webpack_require__, 6327)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 815)
+        __webpack_require__.bind(__webpack_require__, 3693)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 9130)
+        __webpack_require__.bind(__webpack_require__, 3524)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 2097)
+        __webpack_require__.bind(__webpack_require__, 3319)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 9824)
+        __webpack_require__.bind(__webpack_require__, 1890)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.bind(__webpack_require__, 4690)
+        __webpack_require__.bind(__webpack_require__, 2404)
       );
 
       /***/
     },
 
-    /***/ 3958: /***/ () => {
+    /***/ 8980: /***/ () => {
       /***/
     },
 
-    /***/ 2110: /***/ () => {
+    /***/ 1716: /***/ () => {
       /***/
     },
 
-    /***/ 8855: /***/ (
+    /***/ 1675: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -582,7 +582,7 @@
       /***/
     },
 
-    /***/ 9469: /***/ (
+    /***/ 3073: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -594,7 +594,7 @@
         /* harmony export */
       });
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
-        __webpack_require__(3923);
+        __webpack_require__(593);
 
       function RootLayout({ children }) {
         return /*#__PURE__*/ (0,
@@ -613,7 +613,7 @@
     // webpackRuntimeModules
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
-    /******/ __webpack_require__.O(0, [487, 96], () => __webpack_exec__(7150));
+    /******/ __webpack_require__.O(0, [339, 354], () => __webpack_exec__(2663));
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ (_ENTRIES = typeof _ENTRIES === "undefined" ? {} : _ENTRIES)[
       "middleware_app/app-edge-ssr/page"
Diff for middleware.js

Diff too large to display

Diff for edge-ssr.js

Diff too large to display

Diff for image-HASH.js
@@ -1,7 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [2983],
   {
-    /***/ 6745: /***/ (
+    /***/ 7391: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
@@ -9,7 +9,7 @@
       (window.__NEXT_P = window.__NEXT_P || []).push([
         "/image",
         function () {
-          return __webpack_require__(5675);
+          return __webpack_require__(1489);
         },
       ]);
       if (false) {
@@ -18,7 +18,7 @@
       /***/
     },
 
-    /***/ 9053: /***/ (module, exports, __webpack_require__) => {
+    /***/ 9313: /***/ (module, exports, __webpack_require__) => {
       "use strict";
       /* __next_internal_client_entry_do_not_use__  cjs */
       Object.defineProperty(exports, "__esModule", {
@@ -40,17 +40,17 @@
         __webpack_require__(6093)
       );
       const _head = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(8808)
+        __webpack_require__(7964)
       );
-      const _getimgprops = __webpack_require__(1945);
-      const _imageconfig = __webpack_require__(7668);
-      const _imageconfigcontextsharedruntime = __webpack_require__(1694);
-      const _warnonce = __webpack_require__(1876);
-      const _routercontextsharedruntime = __webpack_require__(5575);
+      const _getimgprops = __webpack_require__(8821);
+      const _imageconfig = __webpack_require__(664);
+      const _imageconfigcontextsharedruntime = __webpack_require__(6418);
+      const _warnonce = __webpack_require__(7360);
+      const _routercontextsharedruntime = __webpack_require__(4203);
       const _imageloader = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(3589)
+        __webpack_require__(2489)
       );
-      const _usemergedref = __webpack_require__(6746);
+      const _usemergedref = __webpack_require__(2454);
       // This is replaced by webpack define plugin
       const configEnv = {
         deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
@@ -371,7 +371,7 @@
       /***/
     },
 
-    /***/ 6746: /***/ (module, exports, __webpack_require__) => {
+    /***/ 2454: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -432,7 +432,7 @@
       /***/
     },
 
-    /***/ 1945: /***/ (
+    /***/ 8821: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -448,9 +448,9 @@
           return getImgProps;
         },
       });
-      const _warnonce = __webpack_require__(1876);
-      const _imageblursvg = __webpack_require__(6704);
-      const _imageconfig = __webpack_require__(7668);
+      const _warnonce = __webpack_require__(7360);
+      const _imageblursvg = __webpack_require__(5884);
+      const _imageconfig = __webpack_require__(664);
       const VALID_LOADING_VALUES =
         /* unused pure expression or super */ null && [
           "lazy",
@@ -824,7 +824,7 @@
       /***/
     },
 
-    /***/ 6704: /***/ (__unused_webpack_module, exports) => {
+    /***/ 5884: /***/ (__unused_webpack_module, exports) => {
       "use strict";
       /**
        * A shared function, used on both client and server, to generate a SVG blur placeholder.
@@ -879,7 +879,7 @@
       /***/
     },
 
-    /***/ 965: /***/ (
+    /***/ 9345: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -906,10 +906,10 @@
         },
       });
       const _interop_require_default = __webpack_require__(1739);
-      const _getimgprops = __webpack_require__(1945);
-      const _imagecomponent = __webpack_require__(9053);
+      const _getimgprops = __webpack_require__(8821);
+      const _imagecomponent = __webpack_require__(9313);
       const _imageloader = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(3589)
+        __webpack_require__(2489)
       );
       function getImageProps(imgProps) {
         const { props } = (0, _getimgprops.getImgProps)(imgProps, {
@@ -941,7 +941,7 @@
       /***/
     },
 
-    /***/ 3589: /***/ (__unused_webpack_module, exports) => {
+    /***/ 2489: /***/ (__unused_webpack_module, exports) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -976,7 +976,7 @@
       /***/
     },
 
-    /***/ 5675: /***/ (
+    /***/ 1489: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -993,8 +993,8 @@
 
       // EXTERNAL MODULE: ./node_modules/.pnpm/[email protected]/node_modules/react/jsx-runtime.js
       var jsx_runtime = __webpack_require__(6322);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+main-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_d7fg766ptstyt4prarg74ol27i/node_modules/next/image.js
-      var next_image = __webpack_require__(1695);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@file+..+diff-repo+packages+next+next-packed.tgz_react-dom@19.0.0-rc-380f5d67-20241113_re_k6jswiqskvoeqe45yhuljotqne/node_modules/next/image.js
+      var next_image = __webpack_require__(8106);
       var image_default = /*#__PURE__*/ __webpack_require__.n(next_image); // ./pages/nextjs.png
       /* harmony default export */ const nextjs = {
         src: "/_next/static/media/nextjs.cae0b805.png",
@@ -1024,12 +1024,12 @@
       /***/
     },
 
-    /***/ 1695: /***/ (
+    /***/ 8106: /***/ (
       module,
       __unused_webpack_exports,
       __webpack_require__
     ) => {
-      module.exports = __webpack_require__(965);
+      module.exports = __webpack_require__(9345);
 
       /***/
     },
@@ -1039,7 +1039,7 @@
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(6745)
+      __webpack_exec__(7391)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for 195-HASH.js

Diff too large to display

Diff for main-HASH.js

Diff too large to display

Commit: 5fae289

@karlhorky
Copy link
Contributor

karlhorky commented Sep 18, 2024

This sounds amazing! 😍

I guess this will also resolve other ESM-related errors like ERR_PACKAGE_PATH_NOT_EXPORTED / No "exports" main defined when trying to import an ESM-only package like @shikijs/rehype?

From the error stack trace below, it seems like it's still using the Node.js CommonJS loader internally...

$ next build
⨯ Failed to load next.config.ts, see more info here https://nextjs.org/docs/messages/next-config-error

> Build error occurred
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/runner/work/courses/courses/node_modules/@shikijs/vscode-textmate/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:304:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:594:13)
    at resolveExports (node:internal/modules/cjs/loader:634:36)
    at Module._findPath (node:internal/modules/cjs/loader:724:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1211:27)
    at /home/runner/work/courses/courses/node_modules/next/dist/server/require-hook.js:55:36
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at mod.require (/home/runner/work/courses/courses/node_modules/next/dist/server/require-hook.js:65:28)
    at require (node:internal/modules/helpers:179:18) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

next.config.ts

import withMDX from '@next/mdx';
import rehypeShiki from '@shikijs/rehype';
import type { NextConfig } from 'next';
// ...

const config: NextConfig = {
  reactStrictMode: true,
  experimental: {
    typedRoutes: true,
    // Remove .js from import specifiers, because Next.js and
    // webpack do not yet support TypeScript-style module
    // resolution out of the box
    // https://github.com/webpack/webpack/issues/13252#issuecomment-1171080020
    // https://github.com/vercel/next.js/pull/45423
    // https://github.com/vercel/next.js/issues/58805
    // https://github.com/vercel/next.js/issues/54550
    extensionAlias: {
      '.js': ['.ts', '.tsx', '.js', '.jsx'],
      '.jsx': ['.tsx', '.jsx'],
      '.mjs': ['.mts', '.mjs'],
      '.cjs': ['.cts', '.cjs'],
    },
  },
  pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
  // ...
  transpilePackages: ['@upleveled/cargobay', '@upleveled/global-config'],
  // ...
};

export default withMDX({
  options: {
    // ...
    rehypePlugins: [
      // ...
      [
        rehypeShiki,
        {
          theme: 'dark-plus',
        },
      ],
    ],
  },
})(config);

This is with this package.json from @shikijs/[email protected]:

{
  "name": "@shikijs/vscode-textmate",
  "version": "9.2.2",
  "packageManager": "[email protected]",
  "description": "Shiki's fork of `vscode-textmate`",
  "author": {
    "name": "Microsoft Corporation"
  },
  "exports": {
    ".": {
      "import": "./dist/index.mjs",
      "types": "./dist/index.d.mts"
    }
  },
  "main": "./dist/index.mjs",
  "types": "./dist/index.d.mts",
  "repository": {
    "type": "git",
    "url": "https://github.com/shikijs/vscode-textmate"
  },
  "files": [
    "dist"
  ],
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/shikijs/vscode-textmate/issues"
  },
  "scripts": {
    "build": "tsup",
    "watch": "tsc --watch",
    "compile": "tsc",
    "test": "mocha --ui=tdd ./out/tests/all.test.js",
    "benchmark": "node benchmark/benchmark.js",
    "inspect": "node out/tests/inspect.js",
    "tmconvert": "node scripts/tmconvert.js",
    "version": "npm run compile && npm run test",
    "postversion": "git push && git push --tags",
    "prepublishOnly": "npm run build",
    "release": "bumpp && npm publish"
  },
  "devDependencies": {
    "@types/mocha": "^9.1.0",
    "@types/node": "^16.6.1",
    "bumpp": "^9.5.2",
    "mocha": "^9.2.2",
    "tsup": "^8.2.4",
    "typescript": "^4.3.5",
    "vscode-oniguruma": "^1.5.1"
  }
}

@devjiwonchoi Or if this is unrelated, I can also open a different issue...

@karlhorky
Copy link
Contributor

@karlhorky
Copy link
Contributor

karlhorky commented Sep 18, 2024

@devjiwonchoi for ESM projects using "type": "module", is there currently a way to patch node_modules (before this PR lands) that would allow for this custom loader described in the PR description?

I'm ok with disabling the CommonJS behavior - this particular project is ESM.

I tried for a few minutes reading through the SWC docs and checking out the files in the node_modules/next/dist/build/next-config-ts/ folder:

  1. node_modules/next/dist/build/next-config-ts/transpile-config.js
  2. node_modules/next/dist/build/next-config-ts/require-hook.js

But my first attempts failed so far... not familiar with common SWC patterns for this.

Maybe upgrading to Node.js v22 for --experimental-require-module would help with being able to require ESM modules... 🤔

@karlhorky
Copy link
Contributor

karlhorky commented Sep 18, 2024

Workaround

For my use case, it seems like the ERR_PACKAGE_PATH_NOT_EXPORTED / No "exports" main defined error is no longer thrown with this patch (switching swc module.type to 'es6' and switching from require() to dynamic import()):

node_modules/next/dist/build/next-config-ts/transpile-config.js

diff --git a/node_modules/next/dist/build/next-config-ts/transpile-config.js b/node_modules/next/dist/build/next-config-ts/transpile-config.js
index f61819c..3f87f9b 100644
--- a/node_modules/next/dist/build/next-config-ts/transpile-config.js
+++ b/node_modules/next/dist/build/next-config-ts/transpile-config.js
@@ -24,7 +24,7 @@ function resolveSWCOptions(cwd, compilerOptions) {
             baseUrl: resolvedBaseUrl
         },
         module: {
-            type: 'commonjs'
+            type: 'es6'
         },
         isModule: 'unknown'
     };
@@ -59,8 +59,12 @@ async function transpileConfig({ nextConfigPath, cwd }) {
             (0, _requirehook.registerHook)(swcOptions);
             hasRequire = true;
         }
-        // filename & extension don't matter here
-        return (0, _requirehook.requireFromString)(code, (0, _nodepath.join)(cwd, 'next.config.compiled.js'));
+        // Support ESM in next.config.ts
+        // https://github.com/vercel/next.js/pull/68365#issuecomment-2358349887
+        const compiledConfigPath = (0, _nodepath.join)(cwd, '.next', 'next.config.compiled.mjs');
+        await (0, _promises.mkdir)((0, _nodepath.join)(cwd, '.next'), { recursive: true });
+        await (0, _promises.writeFile)(compiledConfigPath, code, 'utf8');
+        return await import(compiledConfigPath);
     } catch (error) {
         throw error;
     } finally{

Downside: Creates a new file in the .next/ folder

If you want to apply this patch, check out pnpm patch or patch-package

@devjiwonchoi
Copy link
Member Author

@karlhorky Hi, thank you for sharing your case! I'm currently investigating on it, and will bring what's the best for you and the community's cases! Again, thank you for your suggestion, and patience.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants