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>( ...@@ -93,17 +93,13 @@ export function patchConsoleMethod<T extends keyof Console>(
wrapper(methodName, ...args) wrapper(methodName, ...args)
/* /*
* This script is from Next.js. * This script is from Next.js console patching.
* 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.
* *
* To remove this script from stack traces, open your browser's DevTools before * You're seeing this because Next.js patches console methods to send logs
* these console calls happen. * to your terminal.
* *
* Or, to prevent Next.js from patching the console, go to your next.config file * To see the original location, set browserDebugInfoInTerminal to false
* and set browserDebugInfoInTerminal to false. * in your next.config file.
*/ */
originalMethod.apply(this, args) originalMethod.apply(this, args)
} }
......
import { UNDEFINED_MARKER } from '../../shared/log-patch' import { UNDEFINED_MARKER } from '../../shared/console-patch'
import { import {
preLogSerializationClone, preLogSerializationClone,
PROMISE_MARKER, PROMISE_MARKER,
......
...@@ -16,7 +16,7 @@ import { ...@@ -16,7 +16,7 @@ import {
type LogMethod, type LogMethod,
patchConsoleMethod, patchConsoleMethod,
UNDEFINED_MARKER, UNDEFINED_MARKER,
} from '../../shared/log-patch' } from '../../shared/console-patch'
const terminalLoggingConfig = getTerminalLoggingConfig() const terminalLoggingConfig = getTerminalLoggingConfig()
export const PROMISE_MARKER = 'Promise {}' export const PROMISE_MARKER = 'Promise {}'
......
...@@ -12,7 +12,7 @@ import { ...@@ -12,7 +12,7 @@ import {
type LogMethod, type LogMethod,
type ConsoleEntry, type ConsoleEntry,
UNDEFINED_MARKER, UNDEFINED_MARKER,
} from '../../../next-devtools/shared/log-patch' } from '../../../next-devtools/shared/console-patch'
import type { NextConfigComplete } from '../../config-shared' import type { NextConfigComplete } from '../../config-shared'
export function getDisplayedSourceLocation( 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