Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". #58720
Unanswered
niallam22
asked this question in
App Router
Replies: 4 comments 3 replies
-
Is Is the |
Beta Was this translation helpful? Give feedback.
3 replies
-
i have same problem, did you find solution? |
Beta Was this translation helpful? Give feedback.
0 replies
-
no I didn't, please let me know if you do.
…On Fri, 24 Nov 2023 at 05:48, Nika Ko ***@***.***> wrote:
i got have same problem, did you find solution?
—
Reply to this email directly, view it on GitHub
<#58720 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJP7WFUWHYCNMJURGTA7TU3YGAYL5AVCNFSM6AAAAAA7UHCUFCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMNJXGI2DE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
im having this same issue |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I have created a server action to complete a POST checkout request. I use the server action in my client component, passing the product data to the action. I have declared the server action with use server but still get this error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".
I have found this discussion #49625
which says it is not possible to use component props directly inside of the action so you have to pass the data into a hidden input and after do the logic inside of the action. However, I am not sure what this means or how to apply it.
Here is my code.
Server action:
Client component:
Beta Was this translation helpful? Give feedback.
All reactions