Skip to content

Commit 67c6171

Browse files
committed
Don't dim error messages
1 parent 431c785 commit 67c6171

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/next/src/server/app-render/app-render.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3618,7 +3618,18 @@ async function logMessagesAndSendErrorsToBrowser(
36183618

36193619
const errors: Error[] = []
36203620
for (const message of messages) {
3621-
console.error(message)
3621+
// Log the error to the CLI. Prevent the logs from being dimmed, which we
3622+
// apply for other logs during the spawned validation.
3623+
consoleAsyncStorage.exit(() => {
3624+
console.error(message)
3625+
})
3626+
3627+
// Error instances are also sent to the browser. We're currently using a
3628+
// non-Error message only in debug build mode as a message that is only
3629+
// meant for the CLI. FIXME: This is a bit spooky action at a distance. We
3630+
// should maybe have a more explicit way of determining which messages
3631+
// should be sent to the browser. Regardless, only real errors with a proper
3632+
// stack make sense to be "replayed" in the browser.
36223633
if (message instanceof Error) {
36233634
errors.push(message)
36243635
}

0 commit comments

Comments
 (0)