Error: It is not allowed to define inline "use server" annotated Server Actions in Client Components. #61623
Unanswered
dhairyathedev
asked this question in
Help
Replies: 2 comments 2 replies
-
Well it is pretty clear isn' it? Move it to its own file, and export it from there. The reason being that a server action is server code, which can be called from the client. However, the client bundle must not have access to that code to being with, in order to prevent leakage to the client. Read more here: |
Beta Was this translation helpful? Give feedback.
2 replies
-
Why is this way still in the official training if it doesn't work? |
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
-
Summary
Unable to use
use server
inside a client component.Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions