Next.js Discord

Discord Forum

patchConsoleMethod

Unanswered
Asiatic Lion posted this in #help-forum
Open in Discord
Asiatic LionOP
how can i disable the new patchConsoleMethod thing? or, at least, how can i get an unpatched version of console.log? this new feature breaks console for me :/

6 Replies

Asiatic LionOP
@Asiatic Lion <@328723945266348033> it was in your commit https://github.com/vercel/next.js/pull/80909/files#diff-81d2bc8d09e67be4e8c313a8dfccf35e4a216865b839e4a40a0e3d82147adf33R70
Northeast Congo Lion
experimental: { browserDebugInfoInTerminal: false } in next.config.

Not sure if its been enabled by default, if so then just:

browserDebugInfoInTerminal:false

Can u share what broke?
Asiatic LionOP
@Northeast Congo Lion
when i do console.log(someReactElement); i get this error: Failed to read a named property 'toJSON' from 'Window': Blocked a frame with origin "http://localhost:8000" from accessing a cross-origin frame.

i get this error even when i set browserDebugInfoInTerminal:false in experimental part of the config.

    at safeStringify (is-error.ts:28:15)
    at forward-logs.ts:49:29
    at Array.map (<anonymous>)
    at ClientFileLogger.log (forward-logs.ts:43:8)
    at createLogEntry (forward-logs.ts:334:20)
    at forward-logs.ts:563:9
    at console.log (forward-logs-shared.ts:93:7)
    at eval (NavigationBar.tsx:84:11)

not sure if that's important but i use pages router. i started to get this problem when i migrated from 15.2 to canary
Northeast Congo Lion
thanks, looking into it
Narrow-barred Spanish mackerel
@Asiatic Lion could you provide some setup, like what flags enabled in the next.config, and how you're logging the react element. A minimal repro would be super helpful
Northeast Congo Lion