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

Do not add client entries for route handlers if dynamicIO is disabled #72924

Closed
wants to merge 1 commit into from

Conversation

unstubbable
Copy link
Contributor

Note

This PR is best reviewed with hidden whitespace changes.

To enable "use cache" in route handlers, we started generating client reference manifests and client chunks for route handlers in #70897.

This is currently not required if experimental.dynamicIO is not enabled, so we can skip the additional work during builds.

To enable `"use cache"` in route handlers, we started generating client
reference manifests and client chunks for route handlers in #70897.

This is currently not required if `dynamicIO` is not enabled, so we can
skip the additional work during builds.
@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. type: next labels Nov 18, 2024
@ijjk
Copy link
Member

ijjk commented Nov 18, 2024

Failing test suites

Commit: e31051a

pnpm test-start test/e2e/app-dir/app-routes-subrequests/app-routes-subrequests.test.ts

  • app-routes-subrequests > shortcuts after 5 subrequests
Expand output

● app-routes-subrequests › shortcuts after 5 subrequests

next build failed with code/signal 1

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

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

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

pnpm test-start test/e2e/app-dir/app-routes-trailing-slash/app-routes-trailing-slash.test.ts

  • app-routes-trailing-slash > should handle trailing slash for edge runtime
  • app-routes-trailing-slash > should handle trailing slash for node runtime
Expand output

● app-routes-trailing-slash › should handle trailing slash for edge runtime

next build failed with code/signal 1

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

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

● app-routes-trailing-slash › should handle trailing slash for node runtime

next build failed with code/signal 1

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

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

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-start test/e2e/app-dir/app-simple-routes/app-simple-routes.test.ts (PPR)

  • app-simple-routes > works with simple routes > renders a node route
  • app-simple-routes > works with simple routes > renders a edge route
Expand output

● app-simple-routes › works with simple routes › renders a node route

next build failed with code/signal 1

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

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

● app-simple-routes › works with simple routes › renders a edge route

next build failed with code/signal 1

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

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

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-start test/e2e/app-dir/app-routes/app-custom-route-base-path.test.ts (PPR)

  • app-custom-routes > automatic implementations > implements HEAD on routes with GET already implemented
  • app-custom-routes > automatic implementations > implements OPTIONS on routes
  • app-custom-routes > basic fetch request with a response > abort via a DELETE request > aborts without error on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a DELETE request > aborts without error on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a GET request > aborts without error on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a GET request > aborts without error on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a PATCH request > aborts without error on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a PATCH request > aborts without error on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a POST request > aborts without error on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a POST request > aborts without error on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a PUT request > aborts without error on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a PUT request > aborts without error on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > made via a DELETE request > responds correctly on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > made via a DELETE request > responds correctly on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > made via a GET request > responds correctly on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > made via a GET request > responds correctly on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > made via a PATCH request > responds correctly on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > made via a PATCH request > responds correctly on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > made via a POST request > responds correctly on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > made via a POST request > responds correctly on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > made via a PUT request > responds correctly on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > made via a PUT request > responds correctly on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > request > can read query parameters
  • app-custom-routes > basic fetch request with a response > request > can read query parameters (edge)
  • app-custom-routes > basic fetch request with a response > response > supports the NextResponse.redirect() helper
  • app-custom-routes > basic fetch request with a response > response > supports the NextResponse.json() helper
  • app-custom-routes > basic fetch request with a response > route groups > routes to the correct handler
  • app-custom-routes > body > can handle handle a streaming request and streaming response
  • app-custom-routes > body > can handle handle a streaming request and streaming response (edge)
  • app-custom-routes > body > can read a JSON encoded body
  • app-custom-routes > body > can read a JSON encoded body (edge)
  • app-custom-routes > body > can read a JSON encoded body for DELETE requests
  • app-custom-routes > body > can read a JSON encoded body for OPTIONS requests
  • app-custom-routes > body > can read a streamed JSON encoded body
  • app-custom-routes > body > can read a streamed JSON encoded body (edge)
  • app-custom-routes > body > can read the text body
  • app-custom-routes > body > can read the text body (edge)
  • app-custom-routes > context > provides params to routes with dynamic parameters
  • app-custom-routes > context > provides params to routes with catch-all routes
  • app-custom-routes > context > does not provide params to routes without dynamic parameters
  • app-custom-routes > customized metadata routes > should work if conflict with metadata routes convention
  • app-custom-routes > dynamic = "force-static" > strips search, headers, and domain from request
  • app-custom-routes > edge functions > returns response using edge runtime
  • app-custom-routes > edge functions > returns a response when headers are accessed
  • app-custom-routes > error conditions > responds with 400 (Bad Request) when the requested method is not a valid HTTP method
  • app-custom-routes > error conditions > responds with 405 (Method Not Allowed) when method is not implemented
  • app-custom-routes > error conditions > responds with 500 (Internal Server Error) when the handler throws an error
  • app-custom-routes > error conditions > responds with 500 (Internal Server Error) when the handler calls NextResponse.next()
  • app-custom-routes > hooks > (await cookies()).has() > gets the correct values
  • app-custom-routes > hooks > cookies > gets the correct values
  • app-custom-routes > hooks > headers > gets the correct values
  • app-custom-routes > hooks > notFound > can respond correctly in nodejs
  • app-custom-routes > hooks > notFound > can respond correctly in edge
  • app-custom-routes > hooks > permanentRedirect > can respond correctly
  • app-custom-routes > hooks > redirect > can respond correctly
  • app-custom-routes > hooks > req.cookies > gets the correct values
  • app-custom-routes > no bundle error > should not print bundling warning about React
  • app-custom-routes > no response returned > should print an error when no response is returned
  • app-custom-routes > works with api prefix correctly > statically generates correctly with no dynamic usage
  • app-custom-routes > works with api prefix correctly > does not statically generate with dynamic usage
  • app-custom-routes > works with generateStaticParams correctly > responds correctly on /static/first/data.json
  • app-custom-routes > works with generateStaticParams correctly > responds correctly on /static/second/data.json
  • app-custom-routes > works with generateStaticParams correctly > responds correctly on /static/three/data.json
  • app-custom-routes > works with generateStaticParams correctly > revalidates correctly on /revalidate-1/first/data.json
  • app-custom-routes > works with generateStaticParams correctly > revalidates correctly on /revalidate-1/second/data.json
  • app-custom-routes > works with generateStaticParams correctly > revalidates correctly on /revalidate-1/three/data.json
Expand output

● app-custom-routes › works with api prefix correctly › statically generates correctly with no dynamic usage

next build failed with code/signal 1

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

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

● app-custom-routes › works with api prefix correctly › does not statically generate with dynamic usage

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › responds correctly on /static/first/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › responds correctly on /static/second/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › responds correctly on /static/three/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › revalidates correctly on /revalidate-1/first/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › revalidates correctly on /revalidate-1/second/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › revalidates correctly on /revalidate-1/three/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a GET request › responds correctly on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a GET request › responds correctly on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a POST request › responds correctly on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a POST request › responds correctly on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a PUT request › responds correctly on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a PUT request › responds correctly on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a DELETE request › responds correctly on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a DELETE request › responds correctly on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a PATCH request › responds correctly on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a PATCH request › responds correctly on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a GET request › aborts without error on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a GET request › aborts without error on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a POST request › aborts without error on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a POST request › aborts without error on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a PUT request › aborts without error on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a PUT request › aborts without error on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a DELETE request › aborts without error on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a DELETE request › aborts without error on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a PATCH request › aborts without error on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a PATCH request › aborts without error on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › route groups › routes to the correct handler

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › request › can read query parameters

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › request › can read query parameters (edge)

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › response › supports the NextResponse.rewrite() helper

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › response › supports the NextResponse.redirect() helper

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › response › supports the NextResponse.json() helper

next build failed with code/signal 1

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

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

● app-custom-routes › body › can handle handle a streaming request and streaming response

next build failed with code/signal 1

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

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

● app-custom-routes › body › can handle handle a streaming request and streaming response (edge)

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a JSON encoded body

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a JSON encoded body (edge)

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a JSON encoded body for DELETE requests

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a JSON encoded body for OPTIONS requests

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a streamed JSON encoded body

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a streamed JSON encoded body (edge)

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read the text body

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read the text body (edge)

next build failed with code/signal 1

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

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

● app-custom-routes › context › provides params to routes with dynamic parameters

next build failed with code/signal 1

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

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

● app-custom-routes › context › provides params to routes with catch-all routes

next build failed with code/signal 1

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

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

● app-custom-routes › context › does not provide params to routes without dynamic parameters

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › headers › gets the correct values

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › cookies › gets the correct values

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › req.cookies › gets the correct values

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › (await cookies()).has() › gets the correct values

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › redirect › can respond correctly

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › permanentRedirect › can respond correctly

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › notFound › can respond correctly in nodejs

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › notFound › can respond correctly in edge

next build failed with code/signal 1

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

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

● app-custom-routes › error conditions › responds with 400 (Bad Request) when the requested method is not a valid HTTP method

next build failed with code/signal 1

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

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

● app-custom-routes › error conditions › responds with 405 (Method Not Allowed) when method is not implemented

next build failed with code/signal 1

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

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

● app-custom-routes › error conditions › responds with 500 (Internal Server Error) when the handler throws an error

next build failed with code/signal 1

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

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

● app-custom-routes › error conditions › responds with 500 (Internal Server Error) when the handler calls NextResponse.next()

next build failed with code/signal 1

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

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

● app-custom-routes › automatic implementations › implements HEAD on routes with GET already implemented

next build failed with code/signal 1

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

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

● app-custom-routes › automatic implementations › implements OPTIONS on routes

next build failed with code/signal 1

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

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

● app-custom-routes › edge functions › returns response using edge runtime

next build failed with code/signal 1

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

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

● app-custom-routes › edge functions › returns a response when headers are accessed

next build failed with code/signal 1

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

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

● app-custom-routes › dynamic = "force-static" › strips search, headers, and domain from request

next build failed with code/signal 1

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

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

● app-custom-routes › customized metadata routes › should work if conflict with metadata routes convention

next build failed with code/signal 1

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

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

● app-custom-routes › no response returned › should print an error when no response is returned

next build failed with code/signal 1

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

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

● app-custom-routes › no bundle error › should not print bundling warning about React

next build failed with code/signal 1

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

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

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

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

  • app-custom-routes > automatic implementations > implements HEAD on routes with GET already implemented
  • app-custom-routes > automatic implementations > implements OPTIONS on routes
  • app-custom-routes > basic fetch request with a response > abort via a DELETE request > aborts without error on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a DELETE request > aborts without error on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a GET request > aborts without error on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a GET request > aborts without error on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a PATCH request > aborts without error on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a PATCH request > aborts without error on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a POST request > aborts without error on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a POST request > aborts without error on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a PUT request > aborts without error on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > abort via a PUT request > aborts without error on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > made via a DELETE request > responds correctly on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > made via a DELETE request > responds correctly on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > made via a GET request > responds correctly on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > made via a GET request > responds correctly on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > made via a PATCH request > responds correctly on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > made via a PATCH request > responds correctly on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > made via a POST request > responds correctly on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > made via a POST request > responds correctly on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > made via a PUT request > responds correctly on /basic/endpoint
  • app-custom-routes > basic fetch request with a response > made via a PUT request > responds correctly on /basic/vercel/endpoint
  • app-custom-routes > basic fetch request with a response > request > can read query parameters
  • app-custom-routes > basic fetch request with a response > request > can read query parameters (edge)
  • app-custom-routes > basic fetch request with a response > response > supports the NextResponse.redirect() helper
  • app-custom-routes > basic fetch request with a response > response > supports the NextResponse.json() helper
  • app-custom-routes > basic fetch request with a response > route groups > routes to the correct handler
  • app-custom-routes > body > can handle handle a streaming request and streaming response
  • app-custom-routes > body > can handle handle a streaming request and streaming response (edge)
  • app-custom-routes > body > can read a JSON encoded body
  • app-custom-routes > body > can read a JSON encoded body (edge)
  • app-custom-routes > body > can read a JSON encoded body for DELETE requests
  • app-custom-routes > body > can read a JSON encoded body for OPTIONS requests
  • app-custom-routes > body > can read a streamed JSON encoded body
  • app-custom-routes > body > can read a streamed JSON encoded body (edge)
  • app-custom-routes > body > can read the text body
  • app-custom-routes > body > can read the text body (edge)
  • app-custom-routes > context > provides params to routes with dynamic parameters
  • app-custom-routes > context > provides params to routes with catch-all routes
  • app-custom-routes > context > does not provide params to routes without dynamic parameters
  • app-custom-routes > customized metadata routes > should work if conflict with metadata routes convention
  • app-custom-routes > dynamic = "force-static" > strips search, headers, and domain from request
  • app-custom-routes > edge functions > returns response using edge runtime
  • app-custom-routes > edge functions > returns a response when headers are accessed
  • app-custom-routes > error conditions > responds with 400 (Bad Request) when the requested method is not a valid HTTP method
  • app-custom-routes > error conditions > responds with 405 (Method Not Allowed) when method is not implemented
  • app-custom-routes > error conditions > responds with 500 (Internal Server Error) when the handler throws an error
  • app-custom-routes > error conditions > responds with 500 (Internal Server Error) when the handler calls NextResponse.next()
  • app-custom-routes > hooks > (await cookies()).has() > gets the correct values
  • app-custom-routes > hooks > cookies > gets the correct values
  • app-custom-routes > hooks > headers > gets the correct values
  • app-custom-routes > hooks > notFound > can respond correctly in nodejs
  • app-custom-routes > hooks > notFound > can respond correctly in edge
  • app-custom-routes > hooks > permanentRedirect > can respond correctly
  • app-custom-routes > hooks > redirect > can respond correctly
  • app-custom-routes > hooks > req.cookies > gets the correct values
  • app-custom-routes > no bundle error > should not print bundling warning about React
  • app-custom-routes > no response returned > should print an error when no response is returned
  • app-custom-routes > works with api prefix correctly > statically generates correctly with no dynamic usage
  • app-custom-routes > works with api prefix correctly > does not statically generate with dynamic usage
  • app-custom-routes > works with generateStaticParams correctly > responds correctly on /static/first/data.json
  • app-custom-routes > works with generateStaticParams correctly > responds correctly on /static/second/data.json
  • app-custom-routes > works with generateStaticParams correctly > responds correctly on /static/three/data.json
  • app-custom-routes > works with generateStaticParams correctly > revalidates correctly on /revalidate-1/first/data.json
  • app-custom-routes > works with generateStaticParams correctly > revalidates correctly on /revalidate-1/second/data.json
  • app-custom-routes > works with generateStaticParams correctly > revalidates correctly on /revalidate-1/three/data.json
Expand output

● app-custom-routes › works with api prefix correctly › statically generates correctly with no dynamic usage

next build failed with code/signal 1

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

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

● app-custom-routes › works with api prefix correctly › does not statically generate with dynamic usage

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › responds correctly on /static/first/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › responds correctly on /static/second/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › responds correctly on /static/three/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › revalidates correctly on /revalidate-1/first/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › revalidates correctly on /revalidate-1/second/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › works with generateStaticParams correctly › revalidates correctly on /revalidate-1/three/data.json

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a GET request › responds correctly on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a GET request › responds correctly on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a POST request › responds correctly on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a POST request › responds correctly on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a PUT request › responds correctly on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a PUT request › responds correctly on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a DELETE request › responds correctly on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a DELETE request › responds correctly on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a PATCH request › responds correctly on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › made via a PATCH request › responds correctly on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a GET request › aborts without error on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a GET request › aborts without error on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a POST request › aborts without error on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a POST request › aborts without error on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a PUT request › aborts without error on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a PUT request › aborts without error on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a DELETE request › aborts without error on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a DELETE request › aborts without error on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a PATCH request › aborts without error on /basic/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › abort via a PATCH request › aborts without error on /basic/vercel/endpoint

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › route groups › routes to the correct handler

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › request › can read query parameters

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › request › can read query parameters (edge)

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › response › supports the NextResponse.rewrite() helper

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › response › supports the NextResponse.redirect() helper

next build failed with code/signal 1

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

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

● app-custom-routes › basic fetch request with a response › response › supports the NextResponse.json() helper

next build failed with code/signal 1

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

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

● app-custom-routes › body › can handle handle a streaming request and streaming response

next build failed with code/signal 1

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

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

● app-custom-routes › body › can handle handle a streaming request and streaming response (edge)

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a JSON encoded body

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a JSON encoded body (edge)

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a JSON encoded body for DELETE requests

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a JSON encoded body for OPTIONS requests

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a streamed JSON encoded body

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read a streamed JSON encoded body (edge)

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read the text body

next build failed with code/signal 1

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

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

● app-custom-routes › body › can read the text body (edge)

next build failed with code/signal 1

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

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

● app-custom-routes › context › provides params to routes with dynamic parameters

next build failed with code/signal 1

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

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

● app-custom-routes › context › provides params to routes with catch-all routes

next build failed with code/signal 1

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

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

● app-custom-routes › context › does not provide params to routes without dynamic parameters

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › headers › gets the correct values

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › cookies › gets the correct values

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › req.cookies › gets the correct values

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › (await cookies()).has() › gets the correct values

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › redirect › can respond correctly

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › permanentRedirect › can respond correctly

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › notFound › can respond correctly in nodejs

next build failed with code/signal 1

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

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

● app-custom-routes › hooks › notFound › can respond correctly in edge

next build failed with code/signal 1

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

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

● app-custom-routes › error conditions › responds with 400 (Bad Request) when the requested method is not a valid HTTP method

next build failed with code/signal 1

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

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

● app-custom-routes › error conditions › responds with 405 (Method Not Allowed) when method is not implemented

next build failed with code/signal 1

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

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

● app-custom-routes › error conditions › responds with 500 (Internal Server Error) when the handler throws an error

next build failed with code/signal 1

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

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

● app-custom-routes › error conditions › responds with 500 (Internal Server Error) when the handler calls NextResponse.next()

next build failed with code/signal 1

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

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

● app-custom-routes › automatic implementations › implements HEAD on routes with GET already implemented

next build failed with code/signal 1

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

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

● app-custom-routes › automatic implementations › implements OPTIONS on routes

next build failed with code/signal 1

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

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

● app-custom-routes › edge functions › returns response using edge runtime

next build failed with code/signal 1

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

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

● app-custom-routes › edge functions › returns a response when headers are accessed

next build failed with code/signal 1

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

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

● app-custom-routes › dynamic = "force-static" › strips search, headers, and domain from request

next build failed with code/signal 1

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

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

● app-custom-routes › customized metadata routes › should work if conflict with metadata routes convention

next build failed with code/signal 1

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

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

● app-custom-routes › no response returned › should print an error when no response is returned

next build failed with code/signal 1

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

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

● app-custom-routes › no bundle error › should not print bundling warning about React

next build failed with code/signal 1

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

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

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

__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/e2e/app-dir/edge-runtime-node-compatibility/edge-runtime-node-compatibility.test.ts (PPR)

  • edge runtime node compatibility > [app] supports node:buffer
Expand output

● edge runtime node compatibility › [app] supports node:buffer

FetchError: invalid json response body at http://localhost:41603/buffer reason: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

  11 |       body: 'Hello, world!',
  12 |     })
> 13 |     const json = await res.json()
     |                  ^
  14 |     expect(json).toEqual({
  15 |       'Buffer === B.Buffer': true,
  16 |       encoded: Buffer.from('Hello, world!').toString('base64'),

  at ../node_modules/.pnpm/[email protected][email protected]/node_modules/node-fetch/lib/index.js:273:32
  at Object.<anonymous> (e2e/app-dir/edge-runtime-node-compatibility/edge-runtime-node-compatibility.test.ts:13:18)

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

pnpm test-dev test/e2e/app-dir/edge-route-catchall/edge-route-catchall.test.ts

  • edge-route-catchall > should correctly normalize edge route catch-all with a single param
  • edge-route-catchall > should correctly normalize edge route catch-all with multiple params
Expand output

● edge-route-catchall › should correctly normalize edge route catch-all with a single param

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

Expected: "{\"slug\":[\"one\"]}"
Received: "<!DOCTYPE html><html><head><meta charSet=\"utf-8\" data-next-head=\"\"/><meta name=\"viewport\" content=\"width=device-width\" data-next-head=\"\"/><style data-next-hide-fouc=\"true\">body{display:none}</style><noscript data-next-hide-fouc=\"true\"><style>body{display:block}</style></noscript><noscript data-n-css=\"\"></noscript><script defer=\"\" noModule=\"\" src=\"/_next/static/chunks/polyfills.js\"></script><script src=\"/_next/static/chunks/webpack.js\" defer=\"\"></script><script src=\"/_next/static/chunks/main.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/_app.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/_error.js\" defer=\"\"></script><script src=\"/_next/static/development/_buildManifest.js\" defer=\"\"></script><script src=\"/_next/static/development/_ssgManifest.js\" defer=\"\"></script><noscript id=\"__next_css__DO_NOT_USE__\"></noscript></head><body><div id=\"__next\"></div><script src=\"/_next/static/chunks/react-refresh.js\"></script><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"statusCode\":500}},\"page\":\"/_error\",\"query\":{},\"buildId\":\"development\",\"isFallback\":false,\"err\":{\"name\":\"Error\",\"source\":\"edge-server\",\"message\":\"ENOENT: no such file or directory, open '/tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/.next/server/app/edge/[[...slug]]/route_client-reference-manifest.js'\",\"stack\":\"Error: ENOENT: no such file or directory, open '/tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/.next/server/app/edge/[[...slug]]/route_client-reference-manifest.js'\\n    at Object.readFileUtf8 (node:internal/fs/sync:25:18)\\n    at readFileSync (node:fs:441:19)\\n    at evaluateInContext (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/web/sandbox/context.js:418:50)\\n    at getRuntimeContext (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/web/sandbox/sandbox.js:75:9)\\n    at async runWithTaggedErrors (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/web/sandbox/sandbox.js:81:21)\\n    at async DevServer.runEdgeFunction (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/next-server.js:1139:24)\\n    at async NextNodeServer.handleCatchallRenderRequest (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/next-server.js:248:41)\\n    at async DevServer.handleRequestImpl (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/base-server.js:852:17)\\n    at async (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/dev/next-dev-server.js:373:20)\\n    at async Span.traceAsyncFn (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/trace/trace.js:153:20)\\n    at async DevServer.handleRequest (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/dev/next-dev-server.js:370:24)\\n    at async invokeRender (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/lib/router-server.js:183:21)\\n    at async handleRequest (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/lib/router-server.js:360:24)\\n    at async requestHandlerImpl (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/lib/router-server.js:384:13)\\n    at async Server.requestListener (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/lib/start-server.js:144:13)\"},\"gip\":true,\"scriptLoader\":[]}</script></body></html>"

   9 |     const result = await next.fetch('/edge/one')
  10 |
> 11 |     expect(await result.text()).toBe(JSON.stringify({ slug: ['one'] }))
     |                                 ^
  12 |   })
  13 |
  14 |   it('should correctly normalize edge route catch-all with multiple params', async () => {

  at Object.toBe (e2e/app-dir/edge-route-catchall/edge-route-catchall.test.ts:11:33)

● edge-route-catchall › should correctly normalize edge route catch-all with multiple params

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

Expected: "{\"slug\":[\"one\",\"two\",\"three\"]}"
Received: "<!DOCTYPE html><html><head><meta charSet=\"utf-8\" data-next-head=\"\"/><meta name=\"viewport\" content=\"width=device-width\" data-next-head=\"\"/><style data-next-hide-fouc=\"true\">body{display:none}</style><noscript data-next-hide-fouc=\"true\"><style>body{display:block}</style></noscript><noscript data-n-css=\"\"></noscript><script defer=\"\" noModule=\"\" src=\"/_next/static/chunks/polyfills.js\"></script><script src=\"/_next/static/chunks/webpack.js\" defer=\"\"></script><script src=\"/_next/static/chunks/main.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/_app.js\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/_error.js\" defer=\"\"></script><script src=\"/_next/static/development/_buildManifest.js\" defer=\"\"></script><script src=\"/_next/static/development/_ssgManifest.js\" defer=\"\"></script><noscript id=\"__next_css__DO_NOT_USE__\"></noscript></head><body><div id=\"__next\"></div><script src=\"/_next/static/chunks/react-refresh.js\"></script><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"statusCode\":500}},\"page\":\"/_error\",\"query\":{},\"buildId\":\"development\",\"isFallback\":false,\"err\":{\"name\":\"Error\",\"source\":\"edge-server\",\"message\":\"ENOENT: no such file or directory, open '/tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/.next/server/app/edge/[[...slug]]/route_client-reference-manifest.js'\",\"stack\":\"Error: ENOENT: no such file or directory, open '/tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/.next/server/app/edge/[[...slug]]/route_client-reference-manifest.js'\\n    at Object.readFileUtf8 (node:internal/fs/sync:25:18)\\n    at readFileSync (node:fs:441:19)\\n    at evaluateInContext (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/web/sandbox/context.js:418:50)\\n    at getRuntimeContext (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/web/sandbox/sandbox.js:75:9)\\n    at async runWithTaggedErrors (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/web/sandbox/sandbox.js:81:21)\\n    at async DevServer.runEdgeFunction (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/next-server.js:1139:24)\\n    at async NextNodeServer.handleCatchallRenderRequest (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/next-server.js:248:41)\\n    at async DevServer.handleRequestImpl (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/base-server.js:852:17)\\n    at async (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/dev/next-dev-server.js:373:20)\\n    at async Span.traceAsyncFn (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/trace/trace.js:153:20)\\n    at async DevServer.handleRequest (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/dev/next-dev-server.js:370:24)\\n    at async invokeRender (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/lib/router-server.js:183:21)\\n    at async handleRequest (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/lib/router-server.js:360:24)\\n    at async requestHandlerImpl (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/lib/router-server.js:384:13)\\n    at async Server.requestListener (file:///tmp/next-install-a464b2afcfc94533300584e888b564083773491ee87467cb7ed2add6a30c0dbc/node_modules/.pnpm/file+..+next-repo-26b58b2152e6edc57139f69109f4bdc19a4670e2f3513874523837063224c54f+packages+n_3xafeequubrbspbczjewnoazfu/node_modules/next/dist/server/lib/start-server.js:144:13)\"},\"gip\":true,\"scriptLoader\":[]}</script></body></html>"

  15 |     const result = await next.fetch('/edge/one/two/three')
  16 |
> 17 |     expect(await result.text()).toBe(
     |                                 ^
  18 |       JSON.stringify({ slug: ['one', 'two', 'three'] })
  19 |     )
  20 |   })

  at Object.toBe (e2e/app-dir/edge-route-catchall/edge-route-catchall.test.ts:17:33)

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

pnpm test-start test/e2e/app-dir/next-after-app-deploy/index.test.ts

  • unstable_after() in edge runtime > triggers revalidate from a page
  • unstable_after() in edge runtime > triggers revalidate from a server action
  • unstable_after() in edge runtime > triggers revalidate from a route handler
  • unstable_after() in edge runtime > triggers revalidate from middleware
  • unstable_after() in nodejs runtime > triggers revalidate from a page
  • unstable_after() in nodejs runtime > triggers revalidate from a server action
  • unstable_after() in nodejs runtime > triggers revalidate from a route handler
  • unstable_after() in nodejs runtime > triggers revalidate from middleware
Expand output

● unstable_after() in nodejs runtime › triggers revalidate from a page

next build failed with code/signal 1

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

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

● unstable_after() in nodejs runtime › triggers revalidate from a server action

next build failed with code/signal 1

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

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

● unstable_after() in nodejs runtime › triggers revalidate from a route handler

next build failed with code/signal 1

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

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

● unstable_after() in nodejs runtime › triggers revalidate from middleware

next build failed with code/signal 1

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

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

● unstable_after() in edge runtime › triggers revalidate from a page

next build failed with code/signal 1

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

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

● unstable_after() in edge runtime › triggers revalidate from a server action

next build failed with code/signal 1

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

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

● unstable_after() in edge runtime › triggers revalidate from a route handler

next build failed with code/signal 1

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

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

● unstable_after() in edge runtime › triggers revalidate from middleware

next build failed with code/signal 1

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

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

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

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

  • 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
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

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

Expected: 500
Received: 404

  88 |       await retry(async () => {
  89 |         const res = await fetchViaHTTP(context.appPort, url)
> 90 |         expect(res.status).toBe(500)
     |                            ^
  91 |         const text = await res.text()
  92 |         expectUnsupportedModuleDevError(moduleName, importStatement, text)
  93 |       })

  at toBe (integration/edge-runtime-module-errors/test/module-imports.test.js:90:28)
  at retry (lib/next-test-utils.ts:806:14)
  at Object.<anonymous> (integration/edge-runtime-module-errors/test/module-imports.test.js:88:7)

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

@unstubbable
Copy link
Contributor Author

This change doesn't seem to be worth it at the moment.

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

Successfully merging this pull request may close these issues.

2 participants