fix some error messages not printed in the dev console

This commit is contained in:
Oleksii Bulenok
2026-08-13 16:47:20 +02:00
parent 5edb47eb75
commit b1a6053b91
3 changed files with 41 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
diff --git a/build/src/start/server/serverLogLikeMetro.js b/build/src/start/server/serverLogLikeMetro.js
index b1f633512f0dea3203d1f1acd89edefe02cc30d5..34ed7d1d389ff51c9e08e743c79bd84782d7953d 100644
--- a/build/src/start/server/serverLogLikeMetro.js
+++ b/build/src/start/server/serverLogLikeMetro.js
@@ -176,8 +176,15 @@ async function maybeSymbolicateAndFormatJSErrorStackLogAsync(projectRoot, level,
stack: ((_log_symbolicated = log.symbolicated) == null ? void 0 : (_log_symbolicated_stack = _log_symbolicated.stack) == null ? void 0 : _log_symbolicated_stack.stack) ?? [],
codeFrame: log.codeFrame
});
- // NOTE: Message is printed above stack by the default Metro logic. So we don't need to include it here.
- const symbolicatedErrorStackLog = `\n\n${formatted.stack}`;
+ /*
+ * The original code assumed the message is printed above the stack by the default Metro
+ * logic and returned only the formatted stack. That only holds when the message and stack
+ * arrive as separate console arguments. React 19 owner-stack errors arrive as ONE merged
+ * string ("<message>\n at ..."), so the caller replaces the whole argument with this
+ * return value and the message was silently dropped (terminal showed a blank "Web ERROR").
+ * Prepend the parsed message when present so it is never lost.
+ */
+ const symbolicatedErrorStackLog = error.message ? `${error.message}\n\n${formatted.stack}` : `\n\n${formatted.stack}`;
return {
isFallback: formatted.isFallback,
stack: symbolicatedErrorStackLog
+18
View File
@@ -0,0 +1,18 @@
# @expo/cli
## build/src/start/server/serverLogLikeMetro.js - keep the error message in web terminal logs
Dev-server-terminal-only change; no runtime/app impact.
React 19 appends owner stacks to dev warnings, so a web `console.error`
arrives at the CLI as one merged string (`"<message>\n at ..."`). The
reporter replaces the whole argument with the symbolicated stack block and
dropped the parsed message, printing a blank `Web ERROR` with only a code
frame and call stack.
The patch prepends `error.message` (when non-empty) to the returned stack
block. Native logs are unaffected (message and stack arrive as separate
arguments there).
Unreported upstream as of 2026-08-13; worth filing against expo/expo
referencing expo/expo#46584.
+1
View File
@@ -29,6 +29,7 @@ allowBuilds:
'esbuild': false
'unrs-resolver': true
patchedDependencies:
'@expo/cli@57.0.13': patches/@expo__cli@57.0.13.patch
'@formatjs/bigdecimal@0.2.5': patches/@formatjs__bigdecimal@0.2.5.patch
'@sentry/expo-upload-sourcemaps@8.18.0': patches/@sentry__expo-upload-sourcemaps@8.18.0.patch
'expo-age-range@57.0.2': patches/expo-age-range@57.0.2.patch