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

Undocumented breaking change with custom server between 13.4.1 and 13.5.1 / getRequestHandler does no longer set status code with Koa custom server #65691

Open
clentfort opened this issue May 13, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Runtime Related to Node.js or Edge Runtime with Next.js.

Comments

@clentfort
Copy link

Link to the code that reproduces this issue

https://github.com/clentfort/nextjs-custom-server-breaking-change

To Reproduce

Next v14 and Next v13.5.1

  1. Checkout the repostiories main/v13.5.1 branch repsectively
  2. Run npm i to install all dependencies
  3. Run the dev environment via npm run dev.
  4. Open the page in a browser. Open the dev tools on the network tab. Reload the page.

--> Observer the status code is 404 for all requests. The contents of the page are hidden via CSS

Next 13.4.1

  1. Checkout the repostiories v13.4.1 branch
  2. Run npm i to install all dependencies
  3. Run the dev environment via npm run dev.
  4. Open the page in a browser. Open the dev tools on the network tab. Reload the page.

--> Observer the status code is 200 for all requests. The contents of the page is visible

Current vs. Expected behavior

Currently the status code is not set correctly by getRequestHandler. I'd expect it to set the status code to the correct value (i.e. 200/404) as it was done in 13.4.1.

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020
    Binaries:
      Node: 20.10.0
      npm: 10.4.0
      Yarn: 4.0.2
      pnpm: 8.14.1
    Relevant Packages:
      next: 13.4.1, 13.5.1, 14.2.3 // Latest available version is detected (14.2.3).
      eslint-config-next: N/A
      react: 18.3.1
      react-dom: 18.3.1
      typescript: 4.9.5
    Next.js Config:
      output: N/A

Which area(s) are affected? (Select all that apply)

Not sure, Runtime

Which stage(s) are affected? (Select all that apply)

next dev (local), next start (local)

Additional context

The application is run via Docker, however the behaviour is already visible in dev mode.

@clentfort clentfort added the bug Issue was opened via the bug report template. label May 13, 2024
@github-actions github-actions bot added the Runtime Related to Node.js or Edge Runtime with Next.js. label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Runtime Related to Node.js or Edge Runtime with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant