fix: Invalid URL (404) provided on server actions error (#56323)

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
This commit is contained in:
Alexandre Baizeau 2023-10-02 18:32:43 -04:00 committed by GitHub
parent 3172cfedc8
commit eeb9b3325d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -110,7 +110,7 @@ impl<C: Comments> ServerActions<C> {
handler
.struct_span_err(
body.span,
"It is not allowed to define inline \"use server\" annotated Server Actions in Client Components.\nTo use Server Actions in a Client Component, you can either export them from a separate file with \"use server\" at the top, or pass them down through props from a Server Component.\n\nRead more: https://nextjs.org/docs/app/api-reference/server-actions#with-client-components\n",
"It is not allowed to define inline \"use server\" annotated Server Actions in Client Components.\nTo use Server Actions in a Client Component, you can either export them from a separate file with \"use server\" at the top, or pass them down through props from a Server Component.\n\nRead more: https://nextjs.org/docs/app/api-reference/functions/server-actions#with-client-components\n",
)
.emit()
});

View file

@ -2,7 +2,7 @@
x It is not allowed to define inline "use server" annotated Server Actions in Client Components.
| To use Server Actions in a Client Component, you can either export them from a separate file with "use server" at the top, or pass them down through props from a Server Component.
|
| Read more: https://nextjs.org/docs/app/api-reference/server-actions#with-client-components
| Read more: https://nextjs.org/docs/app/api-reference/functions/server-actions#with-client-components
|
,-[input.js:3:1]
3 | export default function App() {