Skip to content

onSuccess Method Returns Undefined Data in Next.js v14 with next-safe-action v7? #258

Closed Answered by 7codo
7codo asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you for your response! I was able to solve the issue by adjusting the Next.js middleware configuration. Initially, I was setting the headers like this:

return NextResponse.next({
  headers
});

However, I realized the correct approach is:

return NextResponse.next({
  request: {
    headers,
  },
});

This change resolved the problem.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@7codo
Comment options

Answer selected by 7codo
@TheEdoRan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants