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

Rsc header and query params always null on middleware #65787

Open
zecka opened this issue May 15, 2024 · 2 comments
Open

Rsc header and query params always null on middleware #65787

zecka opened this issue May 15, 2024 · 2 comments
Labels
bug Issue was opened via the bug report template. Middleware Related to Next.js Middleware

Comments

@zecka
Copy link

zecka commented May 15, 2024

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/nextjs-middleware-get-rsc-query-params-and-header-vfy9hk?file=%2Fmiddleware.ts%3A23%2C15

To Reproduce

  1. Go to https://codesandbox.io/p/devbox/nextjs-middleware-get-rsc-query-params-and-header-vfy9hk?file=%2Fmiddleware.ts%3A23%2C15
  2. Open network tab on your browser
  3. Clique on link "Page2?test=1"
  4. You will a request to "https://vfy9hk-3000.csb.app/page2?test=1&_rsc=1dou9"

Current vs. Expected behavior

Check console query params test is successfully log but _rsc params is null. rsc header is also null
image

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 14.3.0-canary.63 // Latest available version is detected (14.3.0-canary.63).
  eslint-config-next: N/A
  react: 19.0.0-beta-4508873393-20240430
  react-dom: 19.0.0-beta-4508873393-20240430
  typescript: 5.1.3
Next.js Config:
  output: N/A

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

Middleware

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

next dev (local), next build (local), next start (local), Other (Deployed)

Additional context

No response

@zecka zecka added the bug Issue was opened via the bug report template. label May 15, 2024
@github-actions github-actions bot added the Middleware Related to Next.js Middleware label May 15, 2024
@tigerabrodi
Copy link

tigerabrodi commented May 19, 2024

@zecka good catch!

Is this the most recent version, Next.js 14.2?

@zecka
Copy link
Author

zecka commented May 20, 2024

@tigerabrodi Yes I tested it on 14.2 and 14.3 and Both have the issue

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. Middleware Related to Next.js Middleware
Projects
None yet
Development

No branches or pull requests

2 participants