Hook into server actions on both client and server #80370 #80389
Unanswered
ORESoftware
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
#80370
Link to the code that reproduces this issue
https://gist.github.com/ORESoftware/076b0e365bb0f1ee4da5c0d70da4bb10
To Reproduce
https://gist.github.com/ORESoftware/076b0e365bb0f1ee4da5c0d70da4bb10
with a backend server action:
we cannot modify response headers (add metadata)
cannot log response status code or automatically log response body as json
likewise on the client:
we cannot add metadata to the request - we cannot modify request headers using fetch
aka, I want to pass a unique uuid as a header to represent the reuqest id, etc
looking for a way to hook into server actions for both client and server for these reasons
Current vs. Expected behavior
expect to be able to use more http features with server actions etc
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:06:57 PDT 2024; root:xnu-11215.41.3~3/RELEASE_ARM64_T6041
Binaries:
Node: v24.1.0
npm: 11.3.0
Yarn: N/A
pnpm: 10.11.0
Relevant Packages:
next: 15.3.3
eslint-config-next: ^15.3.3
react: ^19.1.0
react-dom: ^19.1.0
typescript: ^5.7.3
Which area(s) are affected? (Select all that apply)
Middleware
Which stage(s) are affected? (Select all that apply)
next start (local)
Additional context
It's also related to logging in the middleware - if we could log the response status and logging body as json (at the debug level) that would be nice!
Additional information
https://github.com/vercel/next.js/issues/80370
Example
https://gist.github.com/ORESoftware/076b0e365bb0f1ee4da5c0d70da4bb10
Beta Was this translation helpful? Give feedback.
All reactions