Skip to content

Commit 5b0ef21

Browse files
authored
s/server action/server function (#31005)
## Overview Changes the error message to say "Server Functions" instead of "Server Actions" since this error can fire in cases like: ``` <button onClick={serverFunction} /> ``` Which is calling a server function, not a server action.
1 parent 7670501 commit 5b0ef21

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/react-client/src/ReactFlightReplyClient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ export function processReply(
693693
) {
694694
if (temporaryReferences === undefined) {
695695
throw new Error(
696-
'Only plain objects, and a few built-ins, can be passed to Server Actions. ' +
696+
'Only plain objects, and a few built-ins, can be passed to Server Functions. ' +
697697
'Classes or null prototypes are not supported.' +
698698
(__DEV__ ? describeObjectForErrorMessage(parent, key) : ''),
699699
);

scripts/error-codes/codes.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@
484484
"496": "Only objects or functions can be passed to taintObjectReference. Try taintUniqueValue instead.",
485485
"497": "Only objects or functions can be passed to taintObjectReference.",
486486
"498": "Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported.%s",
487-
"499": "Only plain objects, and a few built-ins, can be passed to Server Actions. Classes or null prototypes are not supported.%s",
487+
"499": "Only plain objects, and a few built-ins, can be passed to Server Functions. Classes or null prototypes are not supported.%s",
488488
"500": "React expected a headers state to exist when emitEarlyPreloads was called but did not find it. This suggests emitEarlyPreloads was called more than once per request. This is a bug in React.",
489489
"501": "The render was aborted with postpone when the shell is incomplete. Reason: %s",
490490
"502": "Cannot read a Client Context from a Server Component.",

0 commit comments

Comments
 (0)