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.
Ricky committed
Dec 2, 2024 at 10:02 UTC
5b0ef217ef32333a8e56f39be04327c89efa346f
2 files changed
+2
-2
packages/react-client/src/ReactFlightReplyClient.js
+1
-1
@@ -693,7 +693,7 @@ export function processReply(
693
) {
694
if (temporaryReferences === undefined) {
695
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. ' +
697
'Classes or null prototypes are not supported.' +
698
(__DEV__ ? describeObjectForErrorMessage(parent, key) : ''),
699
);
scripts/error-codes/codes.json
+1
-1
@@ -484,7 +484,7 @@
484
"496": "Only objects or functions can be passed to taintObjectReference. Try taintUniqueValue instead.",
485
"497": "Only objects or functions can be passed to taintObjectReference.",
486
"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",
488
"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.",
489
"501": "The render was aborted with postpone when the shell is incomplete. Reason: %s",
490
"502": "Cannot read a Client Context from a Server Component.",