Repository navigation
fix(console): do not group consecutive messages that log different objects - #3642
Merged
OrKoN merged 1 commit intoNov 26, 2026
Merged
Conversation
…jects Grouping compared the message text, which renders every object argument as `[object Object]`, so logging different objects in a loop showed as one line and hid the other message IDs. A number and a string with the same text were also grouped. Like DevTools, also compare the arguments' remote objects, and never group a message that logs an object other than an error or null. Uncaught errors still group by their text.
OrKoN
approved these changes
Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
list_console_messagesmerges consecutive messages that log different objects into one line.groupConsecutive()compares type, text and argument count, and the text comes from Puppeteer'smsg.text(), which renders every object argument as a fixed placeholder like[object Object]. So a loop such asitems.forEach(i => console.log(i))shows up as a single entry, and only the first message ID is listed. The other objects can only be reached by guessing their IDs forget_console_message.#1939 kept only the first ID on the assumption that grouped messages are identical. That doesn't hold for object arguments. A number and a string with the same text (
console.log(1)thenconsole.log('1')) were also merged.Reproduction
A page that runs:
list_console_messageson main:get_console_message msgid=2returns the second object, but msgid=2 never appears in the list.With this change all 7 messages are listed separately.
Fix
groupConsecutive()now also compares the arguments' remote objects (type, subtype, value, unserializableValue, description), the same fields DevTools compares inConsoleMessage.isEqual. As in DevTools, an argument that is an object other than an error never compares equal. Null is treated as a plain value and still groups. Uncaught errors have no arguments, so they still group by their text as before.User-visible changes
Both places that use
groupConsecutive()change the same way:list_console_messagesand the "Console errors during this call" section thatnavigate_page,evaluate_scriptand other tools append.[N times]. A loop that logs objects now produces N lines, so output grows in that case. Because there are fewer groups, the 10-entry cap on "Console errors during this call" can fill sooner.Tests
Seven new cases in
tests/formatters/ConsoleFormatterGrouping.test.ts. Three fail on main (different objects, number vs string, errors with different stacks) and pass with the fix. The others check that same strings, null, same errors and repeated uncaught errors still group.npm run check-formatandnpm run buildare clean.npm run testpasses locally (macOS arm64, Node 24, Chrome for Testing 157). I also ran the built server against the page above and against pages logging repeated strings, repeated uncaught errors fromsetInterval, and repeated identical promise rejections: those still group.Same call site is still not part of the comparison (DevTools also compares url, line and stack), so identical text logged from different lines still groups, same as main. That seemed like a separate change.