diff --git a/packages/react-client/src/__tests__/ReactFlight-test.js b/packages/react-client/src/__tests__/ReactFlight-test.js
index e0947c68811d2..4961cbcff72a0 100644
--- a/packages/react-client/src/__tests__/ReactFlight-test.js
+++ b/packages/react-client/src/__tests__/ReactFlight-test.js
@@ -156,10 +156,15 @@ describe('ReactFlight', () => {
return
;
}
- const event = ReactNoopFlightServer.render();
- const fn = ReactNoopFlightServer.render();
- const symbol = ReactNoopFlightServer.render();
- const refs = ReactNoopFlightServer.render();
+ const options = {
+ onError() {
+ // ignore
+ },
+ };
+ const event = ReactNoopFlightServer.render(, options);
+ const fn = ReactNoopFlightServer.render(, options);
+ const symbol = ReactNoopFlightServer.render(, options);
+ const refs = ReactNoopFlightServer.render(, options);
function Client({transport}) {
return ReactNoopFlightClient.read(transport);
@@ -213,7 +218,11 @@ describe('ReactFlight', () => {
);
}
- const data = ReactNoopFlightServer.render();
+ const data = ReactNoopFlightServer.render(, {
+ onError(x) {
+ // ignore
+ },
+ });
function Client({transport}) {
return ReactNoopFlightClient.read(transport);
diff --git a/packages/react-server/src/ReactFizzServer.js b/packages/react-server/src/ReactFizzServer.js
index 739ba0c436aa6..27ff2814ac105 100644
--- a/packages/react-server/src/ReactFizzServer.js
+++ b/packages/react-server/src/ReactFizzServer.js
@@ -142,13 +142,17 @@ type Request = {
// 500 * 1024 / 8 * .8 * 0.5 / 2
const DEFAULT_PROGRESSIVE_CHUNK_SIZE = 12800;
+function defaultErrorHandler(error: mixed) {
+ console['error'](error); // Don't transform to our wrapper
+}
+
export function createRequest(
children: ReactNodeList,
destination: Destination,
responseState: ResponseState,
rootContext: FormatContext,
progressiveChunkSize: number = DEFAULT_PROGRESSIVE_CHUNK_SIZE,
- onError: (error: mixed) => void = noop,
+ onError: (error: mixed) => void = defaultErrorHandler,
onCompleteAll: () => void = noop,
onReadyToStream: () => void = noop,
): Request {
diff --git a/packages/react-server/src/ReactFlightServer.js b/packages/react-server/src/ReactFlightServer.js
index 2a09e21c89a00..d4fa3bd0623cd 100644
--- a/packages/react-server/src/ReactFlightServer.js
+++ b/packages/react-server/src/ReactFlightServer.js
@@ -91,7 +91,9 @@ export type Request = {
const ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
-function defaultErrorHandler() {}
+function defaultErrorHandler(error: mixed) {
+ console['error'](error); // Don't transform to our wrapper
+}
export function createRequest(
model: ReactModel,