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

perf: merge middleware, api layers into rsc layer #65660

Closed
wants to merge 1 commit into from

Conversation

huozhi
Copy link
Member

@huozhi huozhi commented May 12, 2024

No description provided.

@huozhi huozhi changed the title perf: Merge middleware, api layers into rsc layer perf: merge middleware, api layers into rsc layer May 12, 2024
@huozhi huozhi force-pushed the rsc/bundle-react-rsc-pages-api branch from 3c1ef84 to b218bf2 Compare May 12, 2024 10:33
@ijjk
Copy link
Member

ijjk commented May 12, 2024

Failing test suites

Commit: 1b1b083

pnpm test test/integration/build-trace-extra-entries/test/index.test.js

  • build trace with extra entries > production mode > should build and trace correctly
Expand output

● build trace with extra entries › production mode › should build and trace correctly

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

Expected: 0
Received: 1

  18 |         })
  19 |         console.log(result)
> 20 |         expect(result.code).toBe(0)
     |                             ^
  21 |
  22 |         const appTrace = await fs.readJSON(
  23 |           join(appDir, '.next/server/pages/_app.js.nft.json')

  at Object.toBe (integration/build-trace-extra-entries/test/index.test.js:20:29)

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

pnpm test test/integration/app-dynamic-error/test/index.test.ts

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

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

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

Expected substring: "Error occurred prerendering page \"/dynamic-error\""
Received string:    "Failed to compile.·
../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react/jsx-runtime'·
https://nextjs.org/docs/messages/module-not-found·
../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react'·
https://nextjs.org/docs/messages/module-not-found·
./app/dynamic-error/loading.js
Module not found: Can't resolve 'react/jsx-runtime'·
https://nextjs.org/docs/messages/module-not-found·
./app/dynamic-error/page.js
Module not found: Can't resolve 'react/jsx-runtime'·
https://nextjs.org/docs/messages/module-not-found·
./app/layout.js
Module not found: Can't resolve 'react/jsx-runtime'·
https://nextjs.org/docs/messages/module-not-found··
> Build failed because of webpack errors
"

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

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

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

pnpm test-start test/e2e/app-dir/app-css-pageextensions/index.test.ts

  • app dir - css with pageextensions > css support with pageextensions > page in app directory with pageextention, css should work > should support global css inside layout
Expand output

● app dir - css with pageextensions › css support with pageextensions › page in app directory with pageextention, css should work › should support global css inside layout

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

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

pnpm test test/integration/app-dir-export/test/dev-custom-dist-dir.test.ts

  • app dir - with output export and custom distDir (next dev) > should render properly
Expand output

● app dir - with output export and custom distDir (next dev) › should render properly

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

Expected: 200
Received: 500

  31 |   it('should render properly', async () => {
  32 |     const res = await fetchViaHTTP(appPort, '/')
> 33 |     expect(res.status).toBe(200)
     |                        ^
  34 |     expect(await res.text()).toContain('Home')
  35 |   })
  36 | })

  at Object.toBe (integration/app-dir-export/test/dev-custom-dist-dir.test.ts:33:24)

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-start test/e2e/app-dir/async-component-preload/async-component-preload.test.ts (PPR)

  • async-component-preload > should handle redirect in an async page
Expand output

● async-component-preload › should handle redirect in an async page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-start test/e2e/app-dir/_allow-underscored-root-directory/_allow-underscored-root-directory.test.ts (PPR)

  • _allow-underscored-root-directory > should not serve app path with underscore
  • _allow-underscored-root-directory > should pages path with a underscore at the root
  • _allow-underscored-root-directory > should serve app path with %5F
Expand output

● _allow-underscored-root-directory › should not serve app path with underscore

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● _allow-underscored-root-directory › should pages path with a underscore at the root

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● _allow-underscored-root-directory › should serve app path with %5F

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

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

pnpm test-start test/e2e/app-dir/draft-mode/draft-mode.test.ts

  • app dir - draft mode > in edge runtime > should use initial rand when draft mode is disabled on /with-edge/index
  • app dir - draft mode > in edge runtime > should use initial rand when draft mode is disabled on /with-edge/with-cookies
  • app dir - draft mode > in edge runtime > should not read other cookies when draft mode disabled during next start
  • app dir - draft mode > in edge runtime > should be disabled from api route handler
  • app dir - draft mode > in edge runtime > should have set-cookie header on enable
  • app dir - draft mode > in edge runtime > should have set-cookie header with redirect location
  • app dir - draft mode > in edge runtime > should genenerate rand when draft mode enabled
  • app dir - draft mode > in edge runtime > should read other cookies when draft mode enabled
  • app dir - draft mode > in edge runtime > should be enabled from api route handler when draft mode enabled
  • app dir - draft mode > in edge runtime > should not perform full page navigation on router.refresh()
  • app dir - draft mode > in nodejs runtime > should use initial rand when draft mode is disabled on /index
  • app dir - draft mode > in nodejs runtime > should use initial rand when draft mode is disabled on /with-cookies
  • app dir - draft mode > in nodejs runtime > should not generate rand when draft mode disabled during next start
  • app dir - draft mode > in nodejs runtime > should not read other cookies when draft mode disabled during next start
  • app dir - draft mode > in nodejs runtime > should be disabled from api route handler
  • app dir - draft mode > in nodejs runtime > should have set-cookie header on enable
  • app dir - draft mode > in nodejs runtime > should have set-cookie header with redirect location
  • app dir - draft mode > in nodejs runtime > should genenerate rand when draft mode enabled
  • app dir - draft mode > in nodejs runtime > should read other cookies when draft mode enabled
  • app dir - draft mode > in nodejs runtime > should be enabled from api route handler when draft mode enabled
  • app dir - draft mode > in nodejs runtime > should not perform full page navigation on router.refresh()
Expand output

● app dir - draft mode › in nodejs runtime › should use initial rand when draft mode is disabled on /index

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in nodejs runtime › should use initial rand when draft mode is disabled on /with-cookies

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in nodejs runtime › should not generate rand when draft mode disabled during next start

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in nodejs runtime › should not read other cookies when draft mode disabled during next start

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in nodejs runtime › should be disabled from api route handler

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in nodejs runtime › should have set-cookie header on enable

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in nodejs runtime › should have set-cookie header with redirect location

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in nodejs runtime › should genenerate rand when draft mode enabled

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in nodejs runtime › should read other cookies when draft mode enabled

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in nodejs runtime › should be enabled from api route handler when draft mode enabled

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in nodejs runtime › should not perform full page navigation on router.refresh()

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in edge runtime › should use initial rand when draft mode is disabled on /with-edge/index

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in edge runtime › should use initial rand when draft mode is disabled on /with-edge/with-cookies

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in edge runtime › should not read other cookies when draft mode disabled during next start

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in edge runtime › should be disabled from api route handler

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in edge runtime › should have set-cookie header on enable

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in edge runtime › should have set-cookie header with redirect location

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in edge runtime › should genenerate rand when draft mode enabled

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in edge runtime › should read other cookies when draft mode enabled

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in edge runtime › should be enabled from api route handler when draft mode enabled

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - draft mode › in edge runtime › should not perform full page navigation on router.refresh()

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-start test/e2e/app-dir/app-basepath-custom-server/index.test.ts (PPR)

  • custom-app-server-action-redirect > redirects with basepath properly when server action handler uses redirect
  • custom-app-server-action-redirect > redirects with proper cookies set from both redirect response and post respose
Expand output

● custom-app-server-action-redirect › redirects with basepath properly when server action handler uses redirect

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● custom-app-server-action-redirect › redirects with proper cookies set from both redirect response and post respose

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

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

pnpm test-start test/e2e/app-dir/app-routes-client-component/app-routes-client-component.test.ts

  • referencing a client component in an app route > responds without error
Expand output

● referencing a client component in an app route › responds without error

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

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

pnpm test test/integration/app-dir-export/test/start.test.ts

  • app dir - with output export (next start) > production mode > should error during next start with output export
  • app dir - with output export (next start) > production mode > should warn during next start with output standalone
Expand output

● app dir - with output export (next start) › production mode › should error during next start with output export

command failed with code 1 signal null
  ▲ Next.js 14.3.0-canary.58

   Creating an optimized production build ...
Failed to compile.

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react'

https://nextjs.org/docs/messages/module-not-found

./app/another/[slug]/page.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

./app/another/page.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

./app/image-import/page.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found


> Build failed because of webpack errors

  282 |       ) {
  283 |         return reject(
> 284 |           new Error(
      |           ^
  285 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  286 |           )
  287 |         )

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

● app dir - with output export (next start) › production mode › should warn during next start with output standalone

command failed with code 1 signal null
  ▲ Next.js 14.3.0-canary.58

   Creating an optimized production build ...
Failed to compile.

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react'

https://nextjs.org/docs/messages/module-not-found

./app/another/[slug]/page.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

./app/another/page.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

./app/image-import/page.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found


> Build failed because of webpack errors

  282 |       ) {
  283 |         return reject(
> 284 |           new Error(
      |           ^
  285 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  286 |           )
  287 |         )

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

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/e2e/app-dir/app-fetch-deduping/app-fetch-deduping.test.ts (PPR)

  • app-fetch-deduping > during next dev > should dedupe requests called from the same component
  • app-fetch-deduping > during next dev > should dedupe pending revalidation requests
Expand output

● app-fetch-deduping › during next dev › should dedupe requests called from the same component

TypeError: Cannot read properties of null (reading 'length')

  54 |       const { next } = nextTestSetup({ files: __dirname })
  55 |       function invocation(cliOutput: string): number {
> 56 |         return cliOutput.match(/Route Handler invoked/g).length
     |                                ^
  57 |       }
  58 |
  59 |       it('should dedupe requests called from the same component', async () => {

  at invocation (e2e/app-dir/app-fetch-deduping/app-fetch-deduping.test.ts:56:32)
  at Object.invocation (e2e/app-dir/app-fetch-deduping/app-fetch-deduping.test.ts:79:16)

● app-fetch-deduping › during next dev › should dedupe pending revalidation requests

next already started

  22 |   public async start(useDirArg: boolean = false) {
  23 |     if (this.childProcess) {
> 24 |       throw new Error('next already started')
     |             ^
  25 |     }
  26 |
  27 |     const useTurbo =

  at NextDevInstance.start (lib/next-modes/next-dev.ts:24:13)
  at Object.start (e2e/app-dir/app-fetch-deduping/app-fetch-deduping.test.ts:84:20)

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

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

  • app dir - basic > should provide query for getStaticProps page correctly
  • app dir - basic > should work for catch-all edge page
  • app dir - basic > should return normalized dynamic route params for catch-all edge page
  • app dir - basic > should have correct searchParams and params (server)
  • app dir - basic > should have correct searchParams and params (client)
  • app dir - basic > should successfully detect app route during prefetch
  • app dir - basic > should match redirects in pages correctly $path
  • app dir - basic > should match redirects in pages correctly $path
  • app dir - basic > should match redirects in pages correctly $path
  • app dir - basic > should match redirects in pages correctly $path
  • app dir - basic > should match redirects in pages correctly $path
  • app dir - basic > should not apply client router filter on shallow
  • app dir - basic > should not share edge workers
  • app dir - basic > should generate build traces correctly
  • app dir - basic > should use text/x-component for flight
  • app dir - basic > should use text/x-component for flight with edge runtime
  • app dir - basic > should return the vary header from edge runtime
  • app dir - basic > should return the vary header from pages for flight requests
  • app dir - basic > should pass props from getServerSideProps in root layout
  • app dir - basic > should serve from pages
  • app dir - basic > should serve dynamic route from pages
  • app dir - basic > should serve from public
  • app dir - basic > should serve from app
  • app dir - basic > should ensure the suffix is at the end of the stream
  • app dir - basic > should serve /index as separate page
  • app dir - basic > should include layouts when no direct parent layout
  • app dir - basic > should use new root layout when provided
  • app dir - basic > should not create new root layout when nested (optional)
  • app dir - basic > should include parent document when no direct parent layout
  • app dir - basic > should not include parent when not in parent directory
  • app dir - basic > should serve nested parent
  • app dir - basic > should serve dynamic parameter
  • app dir - basic > should serve page as a segment name correctly
  • app dir - basic > should include document html and body
  • app dir - basic > should not serve when layout is provided but no folder index
  • app dir - basic > should not rerender layout when navigating between routes in the same layout
  • app dir - basic > should handle hash in initial url
  • app dir - basic > > should hard push
  • app dir - basic > > should hard replace
  • app dir - basic > > should soft push
  • app dir - basic > > should be soft for back navigation
  • app dir - basic > > should be soft for forward navigation
  • app dir - basic > > should allow linking from app page to pages page
  • app dir - basic > > should navigate to pages dynamic route from pages page if it overlaps with an app page
  • app dir - basic > > should push to external url
  • app dir - basic > > should replace to external url
  • app dir - basic > bootstrap scripts > should only bootstrap with one script, prinitializing the rest
  • app dir - basic > bootstrap scripts > should successfully bootstrap even when using CSP
  • app dir - basic > data fetch with response over 16KB with chunked encoding > should load page when fetching a large amount of data
  • app dir - basic > known bugs > should not share flight data between requests
  • app dir - basic > known bugs > should handle router.refresh without resetting state
  • app dir - basic > known bugs > should handle as on next/link
  • app dir - basic > known bugs > should handle next/link back to initially loaded page
  • app dir - basic > known bugs > should not do additional pushState when already on the page
  • app dir - basic > known bugs > should support React cache > server component
  • app dir - basic > known bugs > should support React cache > server component client-navigation
  • app dir - basic > known bugs > should support React cache > client component
  • app dir - basic > known bugs > should support React cache > client component client-navigation
  • app dir - basic > known bugs > should support React cache > middleware overriding headers
  • app dir - basic > known bugs > should support React fetch instrumentation > server component
  • app dir - basic > known bugs > should support React fetch instrumentation > server component client-navigation
  • app dir - basic > next/script > should support next/script and render in correct order
  • app dir - basic > next/script > should pass on extra props for beforeInteractive scripts with a src prop
  • app dir - basic > next/script > should pass on extra props for beforeInteractive scripts without a src prop
  • app dir - basic > next/script > should insert preload tags for beforeInteractive and afterInteractive scripts
  • app dir - basic > next/script > should load stylesheets for next/scripts
  • app dir - basic > next/script > should pass nonce
  • app dir - basic > next/script > should pass nonce when using next/font
  • app dir - basic > rewrites > should support rewrites on initial load
  • app dir - basic > rewrites > should support rewrites on client-side navigation from pages to app with existing pages path
  • app dir - basic > rewrites > should support rewrites on client-side navigation
  • app dir - basic > searchParams prop > client component > should have the correct search params
  • app dir - basic > searchParams prop > client component > should have the correct search params on rewrite
  • app dir - basic > searchParams prop > client component > should have the correct search params on middleware rewrite
  • app dir - basic > searchParams prop > server component > should have the correct search params
  • app dir - basic > searchParams prop > server component > should have the correct search params on rewrite
  • app dir - basic > searchParams prop > server component > should have the correct search params on middleware rewrite
  • app dir - basic > server components > should not serve .server.js as a path
  • app dir - basic > server components > should not serve .client.js as a path
  • app dir - basic > server components > should serve shared component
  • app dir - basic > server components > Loading > should render loading.js in initial html for slow page
  • app dir - basic > server components > Loading > should render loading.js in browser for slow page
  • app dir - basic > server components > Loading > should render loading.js in initial html for slow layout
  • app dir - basic > server components > Loading > should render loading.js in browser for slow layout
  • app dir - basic > server components > Loading > should render loading.js in initial html for slow layout and page
  • app dir - basic > server components > Loading > should render loading.js in browser for slow layout and page
  • app dir - basic > server components > catch-all routes > should handle optional segments
  • app dir - basic > server components > catch-all routes > should handle optional segments root
  • app dir - basic > server components > catch-all routes > should handle optional catch-all segments link
  • app dir - basic > server components > catch-all routes > should handle required segments
  • app dir - basic > server components > catch-all routes > should handle required segments root as not found
  • app dir - basic > server components > catch-all routes > should handle catch-all segments link
  • app dir - basic > server components > client components > should have consistent query and params handling
  • app dir - basic > server components > dynamic routes > should only pass params that apply to the layout
  • app dir - basic > server components > middleware > should strip internal query parameters from requests to middleware for rewrite
  • app dir - basic > server components > middleware > should strip internal query parameters from requests to middleware for redirect
  • app dir - basic > server components > next/router > should support router.back and router.forward
  • app dir - basic > server components > should include client component layout with server component route > should include it server-side
  • app dir - basic > server components > should include client component layout with server component route > should include it client-side
  • app dir - basic > server components > should serve client component > should serve server-side
  • app dir - basic > server components > should serve client component > should serve client-side
  • app dir - basic > template component > should render the template that holds state in a client component and reset on navigation
  • app dir - basic > template component > should render the template that is a server component and rerender on navigation
Expand output

● app dir - basic › should provide query for getStaticProps page correctly

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should work for catch-all edge page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should return normalized dynamic route params for catch-all edge page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should have correct searchParams and params (server)

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should have correct searchParams and params (client)

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should successfully detect app route during prefetch

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should encode chunk path correctly

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should match redirects in pages correctly $path

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should match redirects in pages correctly $path

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should match redirects in pages correctly $path

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should match redirects in pages correctly $path

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should match redirects in pages correctly $path

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should not apply client router filter on shallow

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should not share edge workers

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should generate build traces correctly

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should use text/x-component for flight

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should use text/x-component for flight with edge runtime

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should return the vary header from edge runtime

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should return the vary header from pages for flight requests

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should pass props from getServerSideProps in root layout

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should serve from pages

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should serve dynamic route from pages

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should serve from public

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should serve from app

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should ensure the suffix is at the end of the stream

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should serve /index as separate page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should serve polyfills for browsers that do not support modules

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should handle css imports in next/dynamic correctly

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should include layouts when no direct parent layout

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should not include parent when not in parent directory with route in directory

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should use new root layout when provided

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should not create new root layout when nested (optional)

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should include parent document when no direct parent layout

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should not include parent when not in parent directory

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should serve nested parent

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should serve dynamic parameter

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should serve page as a segment name correctly

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should include document html and body

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should not serve when layout is provided but no folder index

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should match partial parameters

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › rewrites › should support rewrites on initial load

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › rewrites › should support rewrites on client-side navigation from pages to app with existing pages path

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › rewrites › should support rewrites on client-side navigation

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should not rerender layout when navigating between routes in the same layout

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › should handle hash in initial url

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › › should hard push

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › › should hard replace

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › › should soft push

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › › should soft replace

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › › should be soft for back navigation

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › › should be soft for forward navigation

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › › should allow linking from app page to pages page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › › should navigate to pages dynamic route from pages page if it overlaps with an app page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › › should push to external url

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › › should replace to external url

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › should not serve .server.js as a path

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › should not serve .client.js as a path

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › should serve shared component

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › dynamic routes › should only pass params that apply to the layout

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › catch-all routes › should handle optional segments

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › catch-all routes › should handle optional segments root

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › catch-all routes › should handle optional catch-all segments link

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › catch-all routes › should handle required segments

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › catch-all routes › should handle required segments root as not found

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › catch-all routes › should handle catch-all segments link

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › should serve client component › should serve server-side

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › should serve client component › should serve client-side

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › should include client component layout with server component route › should include it server-side

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › should include client component layout with server component route › should include it client-side

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › Loading › should render loading.js in initial html for slow page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › Loading › should render loading.js in browser for slow page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › Loading › should render loading.js in initial html for slow layout

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › Loading › should render loading.js in browser for slow layout

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › Loading › should render loading.js in initial html for slow layout and page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › Loading › should render loading.js in browser for slow layout and page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › middleware › should strip internal query parameters from requests to middleware for rewrite

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › middleware › should strip internal query parameters from requests to middleware for redirect

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › next/router › should support router.back and router.forward

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › server components › client components › should have consistent query and params handling

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › searchParams prop › client component › should have the correct search params

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › searchParams prop › client component › should have the correct search params on rewrite

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › searchParams prop › client component › should have the correct search params on middleware rewrite

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › searchParams prop › server component › should have the correct search params

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › searchParams prop › server component › should have the correct search params on rewrite

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › searchParams prop › server component › should have the correct search params on middleware rewrite

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › template component › should render the template that holds state in a client component and reset on navigation

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › template component › should render the template that is a server component and rerender on navigation

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should support React cache › server component

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should support React cache › server component client-navigation

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should support React cache › client component

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should support React cache › client component client-navigation

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should support React cache › middleware overriding headers

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should support React fetch instrumentation › server component

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should support React fetch instrumentation › server component client-navigation

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should support React fetch instrumentation › client component

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should support React fetch instrumentation › client component client-navigation

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should not share flight data between requests

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should handle router.refresh without resetting state

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should handle as on next/link

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should handle next/link back to initially loaded page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › known bugs › should not do additional pushState when already on the page

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › next/script › should support next/script and render in correct order

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › next/script › should pass on extra props for beforeInteractive scripts with a src prop

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › next/script › should pass on extra props for beforeInteractive scripts without a src prop

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › next/script › should insert preload tags for beforeInteractive and afterInteractive scripts

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › next/script › should load stylesheets for next/scripts

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › next/script › should pass nonce

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › next/script › should pass nonce when using next/font

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › data fetch with response over 16KB with chunked encoding › should load page when fetching a large amount of data

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › bootstrap scripts › should only bootstrap with one script, prinitializing the rest

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

● app dir - basic › bootstrap scripts › should successfully bootstrap even when using CSP

next build failed with code/signal 1

  89 |           if (code || signal)
  90 |             reject(
> 91 |               new Error(`next build failed with code/signal ${code || signal}`)
     |               ^
  92 |             )
  93 |           else resolve()
  94 |         })

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

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

pnpm test-dev test/development/app-dir/missing-required-html-tags/index.test.ts

  • app-dir - missing required html tags > should show error overlay
  • app-dir - missing required html tags > should hmr when you fix the error
Expand output

● app-dir - missing required html tags › should show error overlay

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - missing required html tags should show error overlay 1`

- Snapshot  - 2
+ Received  + 1

- The following tags are missing in the Root Layout: <html>, <body>.
- Read more at https://nextjs.org/docs/messages/missing-root-layout-tags
+ Failed to compile

   9 |
  10 |     expect(await hasRedbox(browser)).toBe(true)
> 11 |     expect(await getRedboxDescription(browser)).toMatchInlineSnapshot(`
     |                                                 ^
  12 |       "The following tags are missing in the Root Layout: <html>, <body>.
  13 |       Read more at https://nextjs.org/docs/messages/missing-root-layout-tags"
  14 |     `)

  at Object.toMatchInlineSnapshot (development/app-dir/missing-required-html-tags/index.test.ts:11:49)

● app-dir - missing required html tags › should hmr when you fix the error

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

Expected: false
Received: true

  35 |     )
  36 |
> 37 |     expect(await hasRedbox(browser)).toBe(false)
     |                                      ^
  38 |     expect(await browser.elementByCss('p').text()).toBe('hello world')
  39 |
  40 |     // Reintroduce the bug, but only missing html tag

  at Object.toBe (development/app-dir/missing-required-html-tags/index.test.ts:37:38)

● app-dir - missing required html tags › should hmr when you fix the error

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `app-dir - missing required html tags should hmr when you fix the error 1`

- Snapshot  - 2
+ Received  + 1

- The following tags are missing in the Root Layout: <html>.
- Read more at https://nextjs.org/docs/messages/missing-root-layout-tags
+ Failed to compile

  23 |
  24 |     expect(await hasRedbox(browser)).toBe(true)
> 25 |     expect(await getRedboxDescription(browser)).toMatchInlineSnapshot(`
     |                                                 ^
  26 |       "The following tags are missing in the Root Layout: <html>.
  27 |       Read more at https://nextjs.org/docs/messages/missing-root-layout-tags"
  28 |     `)

  at Object.toMatchInlineSnapshot (development/app-dir/missing-required-html-tags/index.test.ts:25:49)

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/development/app-dir/hmr-deleted-page/hmr-deleted-page.test.ts (PPR)

  • hmr-deleted-page > should not show errors for a deleted page
Expand output

● hmr-deleted-page › should not show errors for a deleted page

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

Expected: "nested hello world"
Received: ""

  14 |   it('should not show errors for a deleted page', async () => {
  15 |     const browser = await next.browser('/page')
> 16 |     expect(await browser.elementByCss('p').text()).toBe('nested hello world')
     |                                                    ^
  17 |
  18 |     await next.deleteFile('app/page/test.tsx')
  19 |     await next.deleteFile('app/page/style.css')

  at Object.toBe (development/app-dir/hmr-deleted-page/hmr-deleted-page.test.ts:16:52)

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

pnpm test test/integration/app-config-asset-prefix/test/index.test.js

  • App assetPrefix config > should render correctly with assetPrefix: "/"
Expand output

● App assetPrefix config › should render correctly with assetPrefix: "/"

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

Expected: false
Received: true

  26 |     try {
  27 |       await waitFor(2000)
> 28 |       expect(await hasRedbox(browser)).toBe(false)
     |                                        ^
  29 |       const title = await browser.elementById('title').text()
  30 |       expect(title).toBe('IndexPage')
  31 |     } finally {

  at Object.toBe (integration/app-config-asset-prefix/test/index.test.js:28:40)

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

pnpm test test/integration/app-dir-export/test/dynamic-missing-gsp-dev.test.ts

  • app dir - with output export - dynamic missing gsp dev > development mode > should error when dynamic route is missing generateStaticParams
Expand output

● app dir - with output export - dynamic missing gsp dev › development mode › should error when dynamic route is missing generateStaticParams

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

Expected substring: "Page \"/another/[slug]/page\" is missing exported function \"generateStaticParams()\", which is required with \"output: export\" config."
Received string:    "Build Error·
Failed to compile·
Next.js (14.3.0-canary.58)
./app/another/[slug]/page.js
Module not found: Can't resolve 'react/jsx-dev-runtime'·
https://nextjs.org/docs/messages/module-not-found"

  158 |         const header = await getRedboxHeader(browser)
  159 |         const source = await getRedboxSource(browser)
> 160 |         expect(`${header}\n${source}`).toContain(expectedErrMsg)
      |                                        ^
  161 |       } else {
  162 |         await check(() => result.stderr, /error/i)
  163 |       }

  at toContain (integration/app-dir-export/test/utils.ts:160:40)
  at Object.<anonymous> (integration/app-dir-export/test/dynamic-missing-gsp-dev.test.ts:8:9)

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/development/app-hmr/hmr.test.ts (PPR)

  • app-dir-hmr > filesystem changes > should not continously poll when hitting a not found page
  • app-dir-hmr > filesystem changes > should not break when renaming a folder
  • app-dir-hmr > filesystem changes > should update server components pages when env files is changed (nodejs)
Expand output

● app-dir-hmr › filesystem changes › should not continously poll when hitting a not found page

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

Expected substring: "404"
Received string:    ""

  24 |       })
  25 |       const body = await browser.elementByCss('body').text()
> 26 |       expect(body).toContain('404')
     |                    ^
  27 |
  28 |       await waitFor(3000)
  29 |

  at Object.toContain (development/app-hmr/hmr.test.ts:26:20)

● app-dir-hmr › filesystem changes › should not break when renaming a folder

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

Expected: "Hello"
Received: "Build Error"

  34 |       const browser = await next.browser('/folder')
  35 |       const text = await browser.elementByCss('h1').text()
> 36 |       expect(text).toBe('Hello')
     |                    ^
  37 |
  38 |       // Rename folder
  39 |       await next.renameFolder('app/folder', 'app/folder-renamed')

  at Object.toBe (development/app-hmr/hmr.test.ts:36:20)

● app-dir-hmr › filesystem changes › should update server components pages when env files is changed (nodejs)

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

Expected: "mac"
Received: ""

  59 |       const envContent = await next.readFile(envFile)
  60 |       const browser = await next.browser('/env/node')
> 61 |       expect(await browser.elementByCss('p').text()).toBe('mac')
     |                                                      ^
  62 |       await next.patchFile(envFile, 'MY_DEVICE="ipad"')
  63 |
  64 |       try {

  at Object.toBe (development/app-hmr/hmr.test.ts:61:54)

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

pnpm test-dev test/development/app-dir/basic/basic.test.ts

  • basic app-dir tests > should reload app pages without error
Expand output

● basic app-dir tests › should reload app pages without error

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

Expected: false
Received: true

  10 |   it('should reload app pages without error', async () => {
  11 |     const { session, cleanup, browser } = await sandbox(next, undefined, '/')
> 12 |     expect(await session.hasRedbox()).toBe(false)
     |                                       ^
  13 |
  14 |     browser.refresh()
  15 |

  at Object.toBe (development/app-dir/basic/basic.test.ts:12:39)

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

pnpm test-dev test/development/acceptance-app/ReactRefreshModule.test.ts

  • ReactRefreshModule app > should allow any variable names
Expand output

● ReactRefreshModule app › should allow any variable names

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

Expected: false
Received: true

  16 |   it('should allow any variable names', async () => {
  17 |     const { session, cleanup } = await sandbox(next, new Map([]))
> 18 |     expect(await session.hasRedbox()).toBe(false)
     |                                       ^
  19 |
  20 |     const variables = [
  21 |       '_a',

  at Object.toBe (development/acceptance-app/ReactRefreshModule.test.ts:18:39)

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/e2e/app-dir/app-esm-js/index.test.ts (PPR)

  • app-dir - esm js extension > should be able to render nextjs api in app router
  • app-dir - esm js extension > should be able to use nextjs api in pages router
  • app-dir - esm js extension > should support next/og image
Expand output

● app-dir - esm js extension › should be able to render nextjs api in app router

TypeError: Cannot read properties of undefined (reading 'name')

  10 |
  11 |     async function validateDomNodes(selector: string) {
> 12 |       expect(await $(`${selector} .img`).prop('tagName')).toBe('IMG')
     |                                          ^
  13 |       expect(await $(`${selector} .link`).prop('tagName')).toBe('A')
  14 |       expect(await $(`${selector} .typeof-getImageProps`).text()).toContain(
  15 |         'function'

  at initialize.Object.<anonymous>.exports.prop (../node_modules/.pnpm/cheerio@0.22.0/node_modules/cheerio/lib/api/attributes.js:126:28)
  at prop (e2e/app-dir/app-esm-js/index.test.ts:12:42)
  at Object.validateDomNodes (e2e/app-dir/app-esm-js/index.test.ts:19:11)

● app-dir - esm js extension › should be able to use nextjs api in pages router

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

Expected: "with-ext"
Received: undefined

  27 |     const $ = await next.render$('/pages')
  28 |
> 29 |     expect(await $('meta[name="head-value-1"]').attr('content')).toBe(
     |                                                                  ^
  30 |       'with-ext'
  31 |     )
  32 |     expect(await $('meta[name="head-value-2"]').attr('content')).toBe(

  at Object.toBe (e2e/app-dir/app-esm-js/index.test.ts:29:66)

● app-dir - esm js extension › should support next/og image

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

Expected: 200
Received: 500

  38 |   it('should support next/og image', async () => {
  39 |     const res = await next.fetch('/opengraph-image')
> 40 |     expect(res.status).toBe(200)
     |                        ^
  41 |     expect(res.headers.get('content-type')).toBe('image/png')
  42 |   })
  43 | })

  at Object.toBe (e2e/app-dir/app-esm-js/index.test.ts:40:24)

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

pnpm test test/integration/edge-runtime-dynamic-code/test/index.test.js

  • Edge route usage of dynamic code evaluation > development mode > shows a warning when running code with eval
  • Edge route usage of dynamic code evaluation > development mode > shows a warning when running WebAssembly.compile
  • Edge route usage of dynamic code evaluation > development mode > shows a warning when running WebAssembly.instantiate with a buffer parameter
  • Edge route usage of dynamic code evaluation > production mode > should have middleware warning during build
  • Middleware usage of dynamic code evaluation > development mode > shows a warning when running code with eval
  • Middleware usage of dynamic code evaluation > development mode > shows a warning when running WebAssembly.compile
  • Middleware usage of dynamic code evaluation > development mode > shows a warning when running WebAssembly.instantiate with a buffer parameter
  • Middleware usage of dynamic code evaluation > production mode > should have middleware warning during build
Expand output

● Middleware usage of dynamic code evaluation › development mode › shows a warning when running code with eval

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

Expected substring: "Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime"
Received string:    " ✓ Compiled /middleware in 486ms (121 modules)
"

  103 |           expect(await extractValue(res)).toEqual(100)
  104 |           await waitFor(500)
> 105 |           expect(output).toContain(EVAL_ERROR)
      |                          ^
  106 |           // TODO check why that has a backslash on windows
  107 |           expect(output).toMatch(/lib[\\/]utils\.js/)
  108 |           expect(output).toContain('usingEval')

  at Object.toContain (integration/edge-runtime-dynamic-code/test/index.test.js:105:26)

● Middleware usage of dynamic code evaluation › development mode › shows a warning when running WebAssembly.compile

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

Expected substring: "Dynamic WASM code generation (e. g. 'WebAssembly.compile') not allowed in Edge Runtime"
Received string:    ""

  127 |           expect(await extractValue(res)).toEqual(81)
  128 |           await waitFor(500)
> 129 |           expect(output).toContain(WASM_COMPILE_ERROR)
      |                          ^
  130 |           expect(output).toMatch(/lib[\\/]wasm\.js/)
  131 |           expect(output).toContain('usingWebAssemblyCompile')
  132 |           expect(stripAnsi(output)).toContain(

  at Object.toContain (integration/edge-runtime-dynamic-code/test/index.test.js:129:26)

● Middleware usage of dynamic code evaluation › development mode › shows a warning when running WebAssembly.instantiate with a buffer parameter

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

Expected substring: "Dynamic WASM code generation ('WebAssembly.instantiate' with a buffer parameter) not allowed in Edge Runtime"
Received string:    ""

  142 |           expect(await extractValue(res)).toEqual(81)
  143 |           await waitFor(500)
> 144 |           expect(output).toContain(WASM_INSTANTIATE_ERROR)
      |                          ^
  145 |           expect(output).toMatch(/lib[\\/]wasm\.js/)
  146 |           expect(output).toContain('usingWebAssemblyInstantiateWithBuffer')
  147 |           expect(stripAnsi(output)).toContain(

  at Object.toContain (integration/edge-runtime-dynamic-code/test/index.test.js:144:26)

● Middleware usage of dynamic code evaluation › production mode › should have middleware warning during build

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

Expected substring: "Failed to compile"
Received string:    "
 ⚠ The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
 ⚠ Next.js can't recognize the exported `config` field in route \"/middleware\":
Unsupported node type \"CallExpression\" at \"config.matcher\".
The default config will be used instead.
Read More - https://nextjs.org/docs/messages/invalid-page-config
"

  175 |
  176 |         it('should have middleware warning during build', () => {
> 177 |           expect(buildResult.stderr).toContain(`Failed to compile`)
      |                                      ^
  178 |           expect(buildResult.stderr).toContain(
  179 |             `Used by usingEval, usingEvalSync`
  180 |           )

  at Object.toContain (integration/edge-runtime-dynamic-code/test/index.test.js:177:38)

● Edge route usage of dynamic code evaluation › development mode › shows a warning when running code with eval

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

Expected substring: "Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime"
Received string:    " ✓ Compiled /middleware in 248ms (121 modules)
 ✓ Compiled /api in 225ms (137 modules)
 GET /api/route?case=using-eval 200 in 326ms
"

  103 |           expect(await extractValue(res)).toEqual(100)
  104 |           await waitFor(500)
> 105 |           expect(output).toContain(EVAL_ERROR)
      |                          ^
  106 |           // TODO check why that has a backslash on windows
  107 |           expect(output).toMatch(/lib[\\/]utils\.js/)
  108 |           expect(output).toContain('usingEval')

  at Object.toContain (integration/edge-runtime-dynamic-code/test/index.test.js:105:26)

● Edge route usage of dynamic code evaluation › development mode › shows a warning when running WebAssembly.compile

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

Expected substring: "Dynamic WASM code generation (e. g. 'WebAssembly.compile') not allowed in Edge Runtime"
Received string:    " GET /api/route?case=using-webassembly-compile 200 in 7ms
"

  127 |           expect(await extractValue(res)).toEqual(81)
  128 |           await waitFor(500)
> 129 |           expect(output).toContain(WASM_COMPILE_ERROR)
      |                          ^
  130 |           expect(output).toMatch(/lib[\\/]wasm\.js/)
  131 |           expect(output).toContain('usingWebAssemblyCompile')
  132 |           expect(stripAnsi(output)).toContain(

  at Object.toContain (integration/edge-runtime-dynamic-code/test/index.test.js:129:26)

● Edge route usage of dynamic code evaluation › development mode › shows a warning when running WebAssembly.instantiate with a buffer parameter

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

Expected substring: "Dynamic WASM code generation ('WebAssembly.instantiate' with a buffer parameter) not allowed in Edge Runtime"
Received string:    " GET /api/route?case=using-webassembly-instantiate-with-buffer 200 in 6ms
"

  142 |           expect(await extractValue(res)).toEqual(81)
  143 |           await waitFor(500)
> 144 |           expect(output).toContain(WASM_INSTANTIATE_ERROR)
      |                          ^
  145 |           expect(output).toMatch(/lib[\\/]wasm\.js/)
  146 |           expect(output).toContain('usingWebAssemblyInstantiateWithBuffer')
  147 |           expect(stripAnsi(output)).toContain(

  at Object.toContain (integration/edge-runtime-dynamic-code/test/index.test.js:144:26)

● Edge route usage of dynamic code evaluation › production mode › should have middleware warning during build

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

Expected substring: "Failed to compile"
Received string:    "
 ⚠ The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
 ⚠ Next.js can't recognize the exported `config` field in route \"/middleware\":
Unsupported node type \"CallExpression\" at \"config.matcher\".
The default config will be used instead.
Read More - https://nextjs.org/docs/messages/invalid-page-config
"

  175 |
  176 |         it('should have middleware warning during build', () => {
> 177 |           expect(buildResult.stderr).toContain(`Failed to compile`)
      |                                      ^
  178 |           expect(buildResult.stderr).toContain(
  179 |             `Used by usingEval, usingEvalSync`
  180 |           )

  at Object.toContain (integration/edge-runtime-dynamic-code/test/index.test.js:177:38)

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

pnpm test test/integration/tsconfig-verifier/test/index.test.js

  • tsconfig.json verifier > Creates a default tsconfig.json when one is missing
  • tsconfig.json verifier > Works with an empty tsconfig.json (docs)
  • tsconfig.json verifier > Updates an existing tsconfig.json without losing comments
  • tsconfig.json verifier > allows you to set commonjs module mode
  • tsconfig.json verifier > allows you to set es2020 module mode
  • tsconfig.json verifier > allows you to set node16 moduleResolution mode
  • tsconfig.json verifier > allows you to set bundler moduleResolution mode
  • tsconfig.json verifier > allows you to set target mode
  • tsconfig.json verifier > allows you to set node16 module mode
  • tsconfig.json verifier > allows you to set verbatimModuleSyntax true without adding isolatedModules
  • tsconfig.json verifier > allows you to set verbatimModuleSyntax true via extends without adding isolatedModules
  • tsconfig.json verifier > allows you to extend another configuration file
  • tsconfig.json verifier > creates compilerOptions when you extend another config
Expand output

● tsconfig.json verifier › Creates a default tsconfig.json when one is missing

command failed with code 1 signal null
  ▲ Next.js 14.3.0-canary.58

   Creating an optimized production build ...
Failed to compile.

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react'

https://nextjs.org/docs/messages/module-not-found

./app/layout.tsx
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

./app/layout.tsx
Module not found: Can't resolve 'react'

https://nextjs.org/docs/messages/module-not-found

./app/test/page.tsx
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found


> Build failed because of webpack errors

  282 |       ) {
  283 |         return reject(
> 284 |           new Error(
      |           ^
  285 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  286 |           )
  287 |         )

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

● tsconfig.json verifier › Works with an empty tsconfig.json (docs)

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

Expected: 0
Received: 1

  78 |       })
  79 |       expect(stderr + stdout).not.toContain('moduleResolution')
> 80 |       expect(code).toBe(0)
     |                    ^
  81 |
  82 |       expect(await readFile(tsConfig, 'utf8')).toMatchInlineSnapshot(`
  83 |         "{

  at Object.toBe (integration/tsconfig-verifier/test/index.test.js:80:20)

● tsconfig.json verifier › Updates an existing tsconfig.json without losing comments

command failed with code 1 signal null
  ▲ Next.js 14.3.0-canary.58

   Creating an optimized production build ...
Failed to compile.

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react'

https://nextjs.org/docs/messages/module-not-found

./app/layout.tsx
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

./app/layout.tsx
Module not found: Can't resolve 'react'

https://nextjs.org/docs/messages/module-not-found

./app/test/page.tsx
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found


> Build failed because of webpack errors

  282 |       ) {
  283 |         return reject(
> 284 |           new Error(
      |           ^
  285 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  286 |           )
  287 |         )

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

● tsconfig.json verifier › allows you to set commonjs module mode

command failed with code 1 signal null
  ▲ Next.js 14.3.0-canary.58

   Creating an optimized production build ...
Failed to compile.

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react'

https://nextjs.org/docs/messages/module-not-found

./app/layout.tsx
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

./app/layout.tsx
Module not found: Can't resolve 'react'

https://nextjs.org/docs/messages/module-not-found

./app/test/page.tsx
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found


> Build failed because of webpack errors

  282 |       ) {
  283 |         return reject(
> 284 |           new Error(
      |           ^
  285 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  286 |           )
  287 |         )

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

● tsconfig.json verifier › allows you to set es2020 module mode

command failed with code 1 signal null
  ▲ Next.js 14.3.0-canary.58

   Creating an optimized production build ...
Failed to compile.

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

../../../packages/next/dist/client/components/not-found-error.js
Module not found: Can't resolve 'react'

https://nextjs.org/docs/messages/module-not-found

./app/layout.tsx
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found

./app/layout.tsx
Module not found: Can't resolve 'react'

https://nextjs.org/docs/messages/module-not-found

./app/test/page.tsx
Module not found: Can't resolve 'react/jsx-runtime'

https://nextjs.org/docs/messages/module-not-found


> Build failed because of webpack errors

  282 |       ) {
  283 |         return reject(
> 284 |           new Error(
      |           ^
  285 |             `command failed with code ${code} signal ${signal}\n${mergedStdio}`
  286 |           )
  287 |         )

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

● tsconfig.json verifier › allows you to set node16 moduleResolution mode

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

Expected: 0
Received: 1

  313 |       })
  314 |       expect(stderr + stdout).not.toContain('moduleResolution')
> 315 |       expect(code).toBe(0)
      |                    ^
  316 |
  317 |       expect(await readFile(tsConfig, 'utf8')).toMatchInlineSnapshot(`
  318 |         "{

  at Object.toBe (integration/tsconfig-verifier/test/index.test.js:315:20)

● tsconfig.json verifier › allows you to set bundler moduleResolution mode

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

Expected: 0
Received: 1

  369 |       })
  370 |       expect(stderr + stdout).not.toContain('moduleResolution')
> 371 |       expect(code).toBe(0)
      |                    ^
  372 |
  373 |       expect(await readFile(tsConfig, 'utf8')).toMatchInlineSnapshot(`
  374 |         "{

  at Object.toBe (integration/tsconfig-verifier/test/index.test.js:371:20)

● tsconfig.json verifier › allows you to set target mode

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

Expected: 0
Received: 1

  422 |       })
  423 |       expect(stderr + stdout).not.toContain('target')
> 424 |       expect(code).toBe(0)
      |                    ^
  425 |
  426 |       expect(await readFile(tsConfig, 'utf8')).toMatchInlineSnapshot(`
  427 |               "{

  at Object.toBe (integration/tsconfig-verifier/test/index.test.js:424:20)

● tsconfig.json verifier › allows you to set node16 module mode

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

Expected: 0
Received: 1

  478 |       })
  479 |       expect(stderr + stdout).not.toContain('moduleResolution')
> 480 |       expect(code).toBe(0)
      |                    ^
  481 |
  482 |       expect(await readFile(tsConfig, 'utf8')).toMatchInlineSnapshot(`
  483 |         "{

  at Object.toBe (integration/tsconfig-verifier/test/index.test.js:480:20)

● tsconfig.json verifier › allows you to set verbatimModuleSyntax true without adding isolatedModules

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

Expected: 0
Received: 1

  534 |       })
  535 |       expect(stderr + stdout).not.toContain('isolatedModules')
> 536 |       expect(code).toBe(0)
      |                    ^
  537 |
  538 |       expect(await readFile(tsConfig, 'utf8')).toMatchInlineSnapshot(`
  539 |         "{

  at Object.toBe (integration/tsconfig-verifier/test/index.test.js:536:20)

● tsconfig.json verifier › allows you to set verbatimModuleSyntax true via extends without adding isolatedModules

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

Expected: 0
Received: 1

  592 |       })
  593 |       expect(stderr + stdout).not.toContain('isolatedModules')
> 594 |       expect(code).toBe(0)
      |                    ^
  595 |
  596 |       expect(await readFile(tsConfig, 'utf8')).toMatchInlineSnapshot(`
  597 |         "{

  at Object.toBe (integration/tsconfig-verifier/test/index.test.js:594:20)

● tsconfig.json verifier › allows you to extend another configuration file

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

Expected: 0
Received: 1

  690 |       })
  691 |       expect(stderr + stdout).not.toContain('moduleResolution')
> 692 |       expect(code).toBe(0)
      |                    ^
  693 |
  694 |       expect(await readFile(tsConfig, 'utf8')).toMatchInlineSnapshot(`
  695 |         "{

  at Object.toBe (integration/tsconfig-verifier/test/index.test.js:692:20)

● tsconfig.json verifier › creates compilerOptions when you extend another config

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

Expected: 0
Received: 1

  757 |       })
  758 |       expect(stderr + stdout).not.toContain('moduleResolution')
> 759 |       expect(code).toBe(0)
      |                    ^
  760 |
  761 |       expect(await readFile(tsConfig, 'utf8')).toMatchInlineSnapshot(`
  762 |         "{

  at Object.toBe (integration/tsconfig-verifier/test/index.test.js:759:20)

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

pnpm test test/integration/app-dir-export/test/dynamicapiroute-prod.test.ts

  • app dir - with output export - dynamic api route prod > production mode > should work in prod with dynamicApiRoute undefined
  • app dir - with output export - dynamic api route prod > production mode > should work in prod with dynamicApiRoute 'error'
  • app dir - with output export - dynamic api route prod > production mode > should work in prod with dynamicApiRoute 'force-static'
  • app dir - with output export - dynamic api route prod > production mode > should work in prod with dynamicApiRoute 'force-dynamic'
Expand output

● app dir - with output export - dynamic api route prod › production mode › should work in prod with dynamicApiRoute undefined

thrown: "Exceeded timeout of 60000 ms for a test.
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."

  14 |             'export const dynamic = "force-dynamic" on page "/api/json" cannot be used with "output: export".',
  15 |         },
> 16 |       ])(
     |        ^
  17 |         'should work in prod with dynamicApiRoute $dynamicApiRoute',
  18 |         async ({ dynamicApiRoute, expectedErrMsg }) => {
  19 |           await runTests({ isDev: false, dynamicApiRoute, expectedErrMsg })

  at ../node_modules/.pnpm/jest-each@29.7.0/node_modules/jest-each/build/bind.js:47:15
      at Array.forEach (<anonymous>)
  at integration/app-dir-export/test/dynamicapiroute-prod.test.ts:16:8
  at integration/app-dir-export/test/dynamicapiroute-prod.test.ts:4:56
  at Object.describe (integration/app-dir-export/test/dynamicapiroute-prod.test.ts:3:1)

● app dir - with output export - dynamic api route prod › production mode › should work in prod with dynamicApiRoute 'error'

Failed to replace content.

Pattern: const dynamic = 'force-static'

Content: export const dynamic = undefined

export async function GET() {
  return Response.json({ answer: 42 })
}

  719 |     } else if (typeof pattern === 'string') {
  720 |       if (!currentContent.includes(pattern)) {
> 721 |         throw new Error(
      |               ^
  722 |           `Failed to replace content.\n\nPattern: ${pattern}\n\nContent: ${currentContent}`
  723 |         )
  724 |       }

  at File.replace (lib/next-test-utils.ts:721:15)
  at replace (integration/app-dir-export/test/utils.ts:119:13)
  at integration/app-dir-export/test/dynamicapiroute-prod.test.ts:19:25

● app dir - with output export - dynamic api route prod › production mode › should work in prod with dynamicApiRoute 'force-static'

Failed to replace content.

Pattern: const dynamic = 'force-static'

Content: export const dynamic = undefined

export async function GET() {
  return Response.json({ answer: 42 })
}

  719 |     } else if (typeof pattern === 'string') {
  720 |       if (!currentContent.includes(pattern)) {
> 721 |         throw new Error(
      |               ^
  722 |           `Failed to replace content.\n\nPattern: ${pattern}\n\nContent: ${currentContent}`
  723 |         )
  724 |       }

  at File.replace (lib/next-test-utils.ts:721:15)
  at replace (integration/app-dir-export/test/utils.ts:119:13)
  at integration/app-dir-export/test/dynamicapiroute-prod.test.ts:19:25

● app dir - with output export - dynamic api route prod › production mode › should work in prod with dynamicApiRoute 'force-dynamic'

Failed to replace content.

Pattern: const dynamic = 'force-static'

Content: export const dynamic = undefined

export async function GET() {
  return Response.json({ answer: 42 })
}

  719 |     } else if (typeof pattern === 'string') {
  720 |       if (!currentContent.includes(pattern)) {
> 721 |         throw new Error(
      |               ^
  722 |           `Failed to replace content.\n\nPattern: ${pattern}\n\nContent: ${currentContent}`
  723 |         )
  724 |       }

  at File.replace (lib/next-test-utils.ts:721:15)
  at replace (integration/app-dir-export/test/utils.ts:119:13)
  at integration/app-dir-export/test/dynamicapiroute-prod.test.ts:19:25

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

TURBOPACK=1 pnpm test-start test/e2e/module-layer/module-layer.test.ts (turbopack)

  • module layer > with server-only in server targets > should render routes marked with restriction marks without errors /api/mixed
Expand output

● module layer › with server-only in server targets › should render routes marked with restriction marks without errors /api/mixed

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

- Expected  - 1
+ Received  + 1

  Array [
    "/api/mixed",
-   200,
+   500,
  ]

  27 |       it(`should render routes marked with restriction marks without errors ${route}`, async () => {
  28 |         const { status } = await next.fetch(route)
> 29 |         expect([route, status]).toEqual([route, 200])
     |                                 ^
  30 |       })
  31 |     }
  32 |

  at Object.toEqual (e2e/module-layer/module-layer.test.ts:29:33)

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

pnpm test test/integration/edge-runtime-module-errors/test/module-imports.test.js

  • Edge runtime code with imports > Edge API importing unused node.js module > does not throw in dev at runtime
  • Edge runtime code with imports > Edge API importing unused node.js module > production mode > does not throw in production at runtime
  • Edge runtime code with imports > Edge API statically importing node.js module > throws unsupported module error in dev at runtime and highlights the faulty line
  • Edge runtime code with imports > Edge API statically importing node.js module > production mode > throws unsupported module error in production at runtime and prints error on logs
  • Edge runtime code with imports > Middleware importing unused node.js module > does not throw in dev at runtime
  • Edge runtime code with imports > Middleware importing unused node.js module > production mode > does not throw in production at runtime
  • Edge runtime code with imports > Middleware statically importing node.js module > throws unsupported module error in dev at runtime and highlights the faulty line
  • Edge runtime code with imports > Middleware statically importing node.js module > production mode > throws unsupported module error in production at runtime and prints error on logs
Expand output

● Edge runtime code with imports › Edge API statically importing node.js module › throws unsupported module error in dev at runtime and highlights the faulty line

TIMED OUT: success

undefined

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

Expected substring: "The edge runtime does not support Node.js 'path' module"
Received string:    "  ▲ Next.js 14.3.0-canary.58
  - Local:        http://localhost:35695·
 ✓ Starting...
 ✓ Ready in 1472ms
 ⨯ ./pages/api/route.js:2:11
Module not found: Can't resolve 'path'
  1 |
> 2 |           import { basename } from \"path\"
    |           ^
  3 |
  4 |           export default async function handler(request) {
  5 |             basename()·
https://nextjs.org/docs/messages/module-not-found·
Import trace for requested module:
../../../packages/next/dist/build/webpack/loaders/next-edge-function-loader.js?absolutePagePath=%2Froot%2Factions-runner%2F_work%2Fnext.js%2Fnext.js%2Ftest%2Fintegration%2Fedge-runtime-module-errors%2Fpages%2Fapi%2Froute.js&page=%2Fapi%2Froute&rootDir=%2Froot%2Factions-runner%2F_work%2Fnext.js%2Fnext.js%2Ftest%2Fintegration%2Fedge-runtime-module-errors&preferredRegion=&middlewareConfig=e30%3D!
 ○ Compiling /api ...
 ✓ Compiled /_error in 975ms (253 modules)
 GET /api/route 500 in 2136ms
"

  686 |
  687 |   if (hardError) {
> 688 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content + '\n\n' + lastErr)
      |           ^
  689 |   }
  690 |   return false
  691 | }

  at check (lib/next-test-utils.ts:688:11)
  at Object.<anonymous> (integration/edge-runtime-module-errors/test/module-imports.test.js:91:7)

● Edge runtime code with imports › Edge API statically importing node.js module › production mode › throws unsupported module error in production at runtime and prints error on logs

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

Expected substring: "A Node.js module is loaded ('path'"
Received string:    "
 ⚠ The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
Failed to compile.·
./pages/api/route.js:2:11
Module not found: Can't resolve 'path'
  1 |
> 2 |           import { basename } from \"path\"
    |           ^
  3 |
  4 |           export default async function handler(request) {
  5 |             basename()·
https://nextjs.org/docs/messages/module-not-found·
Import trace for requested module:
../../../packages/next/dist/build/webpack/loaders/next-edge-function-loader.js?absolutePagePath=private-next-pages%2Fapi%2Froute.js&page=%2Fapi%2Froute&rootDir=%2Froot%2Factions-runner%2F_work%2Fnext.js%2Fnext.js%2Ftest%2Fintegration%2Fedge-runtime-module-errors&preferredRegion=&middlewareConfig=e30%3D!··
> webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias
"

  101 |             stderr: true,
  102 |           })
> 103 |           expect(stderr).toContain(getUnsupportedModuleWarning(moduleName))
      |                          ^
  104 |           context.app = await nextStart(
  105 |             context.appDir,
  106 |             context.appPort,

  at Object.toContain (integration/edge-runtime-module-errors/test/module-imports.test.js:103:26)

● Edge runtime code with imports › Middleware statically importing node.js module › throws unsupported module error in dev at runtime and highlights the faulty line

TIMED OUT: success

undefined

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

Expected substring: "The edge runtime does not support Node.js 'path' module"
Received string:    "  ▲ Next.js 14.3.0-canary.58
  - Local:        http://localhost:43597·
 ✓ Starting...
 ✓ Ready in 1483ms
 ○ Compiling /middleware ...
 ⨯ ./middleware.js:3:11
Module not found: Can't resolve 'path'
  1 |
  2 |           import { NextResponse } from 'next/server'
> 3 |           import { basename } from \"path\"
    |           ^
  4 |
  5 |           export async function middleware(request) {
  6 |             basename()·
https://nextjs.org/docs/messages/module-not-found
 ✓ Compiled /_error in 1028ms (253 modules)
 GET / 500 in 12ms
"

  686 |
  687 |   if (hardError) {
> 688 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content + '\n\n' + lastErr)
      |           ^
  689 |   }
  690 |   return false
  691 | }

  at check (lib/next-test-utils.ts:688:11)
  at Object.<anonymous> (integration/edge-runtime-module-errors/test/module-imports.test.js:91:7)

● Edge runtime code with imports › Middleware statically importing node.js module › production mode › throws unsupported module error in production at runtime and prints error on logs

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

Expected substring: "A Node.js module is loaded ('path'"
Received string:    "
 ⚠ The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
Failed to compile.·
./middleware.js:3:11
Module not found: Can't resolve 'path'
  1 |
  2 |           import { NextResponse } from 'next/server'
> 3 |           import { basename } from \"path\"
    |           ^
  4 |
  5 |           export async function middleware(request) {
  6 |             basename()·
https://nextjs.org/docs/messages/module-not-found··
> Build failed because of webpack errors
"

  101 |             stderr: true,
  102 |           })
> 103 |           expect(stderr).toContain(getUnsupportedModuleWarning(moduleName))
      |                          ^
  104 |           context.app = await nextStart(
  105 |             context.appDir,
  106 |             context.appPort,

  at Object.toContain (integration/edge-runtime-module-errors/test/module-imports.test.js:103:26)

● Edge runtime code with imports › Edge API importing unused node.js module › does not throw in dev at runtime

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

Expected: 200
Received: 500

  286 |       context.app = await launchApp(context.appDir, context.appPort, appOption)
  287 |       const res = await fetchViaHTTP(context.appPort, url)
> 288 |       expect(res.status).toBe(200)
      |                          ^
  289 |       expectNoError(moduleName)
  290 |     })
  291 |     ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(

  at Object.toBe (integration/edge-runtime-module-errors/test/module-imports.test.js:288:26)

● Edge runtime code with imports › Edge API importing unused node.js module › production mode › does not throw in production at runtime

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

Expected substring: "A Node.js module is loaded ('child_process'"
Received string:    "
 ⚠ The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
Failed to compile.·
./pages/api/route.js:4:22
Module not found: Can't resolve 'child_process'
  2 |           export default async function handler(request) {
  3 |             if (process.env === 'production') {
> 4 |               (await import(\"child_process\")).spawn('ls', ['-lh', '/usr'])
    |                      ^
  5 |             }
  6 |             return Response.json({ ok: true })
  7 |           }·
https://nextjs.org/docs/messages/module-not-found·
Import trace for requested module:
../../../packages/next/dist/build/webpack/loaders/next-edge-function-loader.js?absolutePagePath=private-next-pages%2Fapi%2Froute.js&page=%2Fapi%2Froute&rootDir=%2Froot%2Factions-runner%2F_work%2Fnext.js%2Fnext.js%2Ftest%2Fintegration%2Fedge-runtime-module-errors&preferredRegion=&middlewareConfig=e30%3D!··
> webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias
"

  296 |             stderr: true,
  297 |           })
> 298 |           expect(stderr).toContain(getUnsupportedModuleWarning(moduleName))
      |                          ^
  299 |           context.app = await nextStart(
  300 |             context.appDir,
  301 |             context.appPort,

  at Object.toContain (integration/edge-runtime-module-errors/test/module-imports.test.js:298:26)

● Edge runtime code with imports › Middleware importing unused node.js module › does not throw in dev at runtime

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

Expected: 200
Received: 500

  286 |       context.app = await launchApp(context.appDir, context.appPort, appOption)
  287 |       const res = await fetchViaHTTP(context.appPort, url)
> 288 |       expect(res.status).toBe(200)
      |                          ^
  289 |       expectNoError(moduleName)
  290 |     })
  291 |     ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(

  at Object.toBe (integration/edge-runtime-module-errors/test/module-imports.test.js:288:26)

● Edge runtime code with imports › Middleware importing unused node.js module › production mode › does not throw in production at runtime

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

Expected substring: "A Node.js module is loaded ('child_process'"
Received string:    "
 ⚠ The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
Failed to compile.·
./middleware.js:6:22
Module not found: Can't resolve 'child_process'
  4 |           export async function middleware(request) {
  5 |             if (process.env === 'production') {
> 6 |               (await import(\"child_process\")).spawn('ls', ['-lh', '/usr'])
    |                      ^
  7 |             }
  8 |             return NextResponse.next()
  9 |           }·
https://nextjs.org/docs/messages/module-not-found··
> Build failed because of webpack errors
"

  296 |             stderr: true,
  297 |           })
> 298 |           expect(stderr).toContain(getUnsupportedModuleWarning(moduleName))
      |                          ^
  299 |           context.app = await nextStart(
  300 |             context.appDir,
  301 |             context.appPort,

  at Object.toContain (integration/edge-runtime-module-errors/test/module-imports.test.js:298:26)

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

TURBOPACK=1 pnpm test-dev test/e2e/middleware-general/test/index.test.ts (turbopack)

  • Middleware Runtime > with i18n > should only contain middleware route in dev middleware manifest
Expand output

● Middleware Runtime › with i18n › should only contain middleware route in dev middleware manifest

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

- Expected  - 1
+ Received  + 2

  Array [
    Object {
+     "locale": false,
      "originalSource": "/:path*",
-     "regexp": ".*",
+     "regexp": "^/.*$",
    },
  ]

  158 |         )
  159 |         const matchers = await res.json()
> 160 |         expect(matchers).toEqual([{ regexp: '.*', originalSource: '/:path*' }])
      |                          ^
  161 |       })
  162 |     }
  163 |

  at Object.toEqual (e2e/middleware-general/test/index.test.ts:160:26)

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

Base automatically changed from rsc/change-bundling-server-condition to canary May 12, 2024 12:26
@huozhi huozhi force-pushed the rsc/bundle-react-rsc-pages-api branch from b218bf2 to 05f4675 Compare May 12, 2024 12:31
@huozhi huozhi force-pushed the rsc/bundle-react-rsc-pages-api branch from 05f4675 to 1b1b083 Compare May 12, 2024 17:31
@huozhi huozhi closed this May 14, 2024
@huozhi huozhi deleted the rsc/bundle-react-rsc-pages-api branch May 14, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants