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

handle direct response from middlware while try server actions #62469

Open
YellaGoya opened this issue Feb 24, 2024 · 0 comments
Open

handle direct response from middlware while try server actions #62469

YellaGoya opened this issue Feb 24, 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

@YellaGoya
Copy link

Link to the code that reproduces this issue

https://github.com/YellaGoya/middlware-response-handle-nextjs-issue-reproduction

To Reproduce

  1. Start dev ( next dev or npm run dev or bun run dev )
  2. Click Send it
  3. Nothing happens

Current vs. Expected behavior

Current

Blocked by middleware, but no value is returned and try / catch, then / catch doesn't work either

Expected behavior

I thought that even if server actions are used, if they are blocked by middlware ex) NextResponse.json( ... ), there will be some kind of response so that it can be handled on the client side.

Provide environment information

Operating System:
  Platform: linux
  Arch: arm64
  Version: #1 SMP PREEMPT_DYNAMIC Wed Dec 13 18:13:24 UTC 2023
  Available memory (MB): 23663
  Available CPU cores: 4
Binaries:
  Node: 20.10.0
  npm: 10.2.3
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.1.1-canary.71 // Latest available version is detected (14.1.1-canary.71).
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

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

Middleware / Edge (API routes, runtime)

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

next dev (local), next start (local)

Additional context

No response

@YellaGoya YellaGoya added the bug Issue was opened via the bug report template. label Feb 24, 2024
@github-actions github-actions bot added the Runtime Related to Node.js or Edge Runtime with Next.js. label Feb 24, 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