Commit f819c171 authored by RobPruzan's avatar RobPruzan Committed by Jiachi Liu

better user message in log-patch

parent a49c479a
......@@ -93,17 +93,13 @@ export function patchConsoleMethod<T extends keyof Console>(
wrapper(methodName, ...args)
/*
* This script is from Next.js.
* You're likely here because you thought this script sent an error or warning
* to the console. Next.js patches the console to send logs to your terminal
* output, so this file appears as a source. However, the console call actually
* came from another script.
* This script is from Next.js console patching.
*
* To remove this script from stack traces, open your browser's DevTools before
* these console calls happen.
*
* Or, to prevent Next.js from patching the console, go to your next.config file
* and set browserDebugInfoInTerminal to false.
* You're seeing this because Next.js patches console methods to send logs
* to your terminal.
*
* To see the original location, set browserDebugInfoInTerminal to false
* in your next.config file.
*/
originalMethod.apply(this, args)
}
......
import { UNDEFINED_MARKER } from '../../shared/log-patch'
import { UNDEFINED_MARKER } from '../../shared/console-patch'
import {
preLogSerializationClone,
PROMISE_MARKER,
......
......@@ -16,7 +16,7 @@ import {
type LogMethod,
patchConsoleMethod,
UNDEFINED_MARKER,
} from '../../shared/log-patch'
} from '../../shared/console-patch'
const terminalLoggingConfig = getTerminalLoggingConfig()
export const PROMISE_MARKER = 'Promise {}'
......
......@@ -12,7 +12,7 @@ import {
type LogMethod,
type ConsoleEntry,
UNDEFINED_MARKER,
} from '../../../next-devtools/shared/log-patch'
} from '../../../next-devtools/shared/console-patch'
import type { NextConfigComplete } from '../../config-shared'
export function getDisplayedSourceLocation(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment