diff --git a/packages/react-client/src/__tests__/ReactFlight-test.js b/packages/react-client/src/__tests__/ReactFlight-test.js
index 3d4ccf5c459f1..325c2fc2a6352 100644
--- a/packages/react-client/src/__tests__/ReactFlight-test.js
+++ b/packages/react-client/src/__tests__/ReactFlight-test.js
@@ -228,6 +228,49 @@ describe('ReactFlight', () => {
});
});
+ it('should trigger the inner most error boundary when serialization fails', () => {
+ function ClientComponent({children}) {
+ // This should catch the error thrown by the server component, even though it has already happened.
+ // We currently need to wrap it in a div because as it's set up right now, a lazy reference will
+ // throw during reconciliation which will trigger the parent of the error boundary.
+ // This is similar to how these will suspend the parent if it's a direct child of a Suspense boundary.
+ // That's a bug.
+ return (
+
+ {children}
+
+ );
+ }
+
+ const ClientComponentReference = moduleReference(ClientComponent);
+
+ function Server() {
+ return (
+
+
+
+ );
+ }
+
+ const data = ReactNoopFlightServer.render();
+
+ function Client({transport}) {
+ return ReactNoopFlightClient.read(transport);
+ }
+
+ act(() => {
+ ReactNoop.render(
+
+
+ ,
+ );
+ });
+ });
+
it('should warn in DEV if a toJSON instance is passed to a host component', () => {
expect(() => {
const transport = ReactNoopFlightServer.render(