Next.js Discord

Discord Forum

Next 13.4 server action

Answered
Alaskan Husky posted this in #help-forum
Open in Discord
Alaskan HuskyOP
Before v13.4, I could return values from server actions, is this no longer possible? It seems to always return undefined.
Answered by Alaskan Husky
@aardani I found the issue to be related to how I was passing the headers in my middleware.
View full answer

12 Replies

thats weird
need more information
@aardani thats weird
Alaskan HuskyOP
@aardani
am I doing anything wrong? This used to work before I upgraded to v14.0.1 this weekend
i couldnt see whats wrong
im on 14 canary and it works fine
can you reproduce the bug?
Alaskan HuskyOP
on the video, I'm explicitly returning a string from the server action, but I get undefined in the client
i meant reproduce the bug on a new repository
Alaskan HuskyOP
ah ok, let me try that
Alaskan HuskyOP
@aardani I found the issue to be related to how I was passing the headers in my middleware.
Answer
Alaskan HuskyOP
I thought these were equivalent