Skip to content

Commit d59ac56

Browse files
committed
Add context for non null prototype error
1 parent 274c980 commit d59ac56

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/react-client/src/__tests__/ReactFlight-test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,10 @@ describe('ReactFlight', () => {
14821482

14831483
expect(errors).toEqual([
14841484
'Only plain objects, and a few built-ins, can be passed to Client Components ' +
1485-
'from Server Components. Classes or null prototypes are not supported.',
1485+
'from Server Components. Classes or null prototypes are not supported.' +
1486+
(__DEV__
1487+
? '\n' + ' <input value={{}}>\n' + ' ^^^^'
1488+
: '\n' + ' {value: {}}\n' + ' ^^'),
14861489
]);
14871490
});
14881491

packages/react-server/src/ReactFlightServer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2615,7 +2615,8 @@ function renderModelDestructive(
26152615
) {
26162616
throw new Error(
26172617
'Only plain objects, and a few built-ins, can be passed to Client Components ' +
2618-
'from Server Components. Classes or null prototypes are not supported.',
2618+
'from Server Components. Classes or null prototypes are not supported.' +
2619+
describeObjectForErrorMessage(parent, parentPropertyName),
26192620
);
26202621
}
26212622
if (__DEV__) {

0 commit comments

Comments
 (0)