Rocky_Mountain_Vending/.pnpm-store/v10/files/d9/8491b840ae5747770fb19b66e15d05352c965d6310da4a666da7b232af1b8e982745883c07920152fd9d9ac15a8bead9b9282b3a8db9b362842d498f67972b
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

40 lines
No EOL
1.7 KiB
Text

import isError from '../../../../lib/is-error';
import { isNextRouterError } from '../../../../client/components/is-next-router-error';
import { handleConsoleError } from './use-error-handler';
import { parseConsoleArgs } from '../../../../client/lib/console';
import { forwardErrorLog } from '../forward-logs';
export const originConsoleError = globalThis.console.error;
// Patch console.error to collect information about hydration errors
export function patchConsoleError() {
// Ensure it's only patched once
if (typeof window === 'undefined') {
return;
}
window.console.error = function error(...args) {
let maybeError;
if (process.env.NODE_ENV !== 'production') {
const { error: replayedError } = parseConsoleArgs(args);
if (replayedError) {
maybeError = replayedError;
} else if (isError(args[0])) {
maybeError = args[0];
} else {
// See https://github.com/facebook/react/blob/d50323eb845c5fde0d720cae888bf35dedd05506/packages/react-reconciler/src/ReactFiberErrorLogger.js#L78
maybeError = args[1];
}
} else {
maybeError = args[0];
}
if (!isNextRouterError(maybeError)) {
if (process.env.NODE_ENV !== 'production') {
handleConsoleError(// replayed errors have their own complex format string that should be used,
// but if we pass the error directly, `handleClientError` will ignore it
maybeError, args);
}
forwardErrorLog(args);
originConsoleError.apply(window.console, args);
}
};
}
//# sourceMappingURL=intercept-console-error.js.map