Skip to content

feat(list_console_messages): include source-mapped location of messages#960

Closed
kopalg20 wants to merge 3 commits intoChromeDevTools:mainfrom
kopalg20:fix-async-source-map-fetch
Closed

feat(list_console_messages): include source-mapped location of messages#960
kopalg20 wants to merge 3 commits intoChromeDevTools:mainfrom
kopalg20:fix-async-source-map-fetch

Conversation

@kopalg20
Copy link
Copy Markdown

I implemented async fetching of source-mapped locations for console messages and uncaught errors.

  • list_console_messages remains fast and non-blocking.

  • get_console_message returns detailed stack traces with resolved source-mapped top frames.

  • Verified with 3000+ simulated errors; performance remains acceptable.

This addresses the request to show the source-mapped location for errors directly, without having to manually parse the stack trace.

Made the changes in src/formatters/ConsoleFormatter.ts

Screenshot 2026-02-14 012632 Screenshot 2026-02-14 012622

@kopalg20 kopalg20 closed this Feb 13, 2026
@kopalg20 kopalg20 changed the title Enhance list_console_messages to show originating source location for console messages (#903) feat(list_console_messages): include source-mapped location of messages Feb 13, 2026
@kopalg20 kopalg20 reopened this Feb 13, 2026
Copy link
Copy Markdown
Collaborator

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, could you please add tests?

Comment thread src/formatters/ConsoleFormatter.ts Outdated
}

toJSONDetailed(): object {
const location = this.#getTopFrameLocation();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the feature is about adding the first line of the stack to the non-detailed variants (toString(), toJSON()) so that the first source line appears in the list of console message. toJSONDetailed is not used in list_console_messages.

Copy link
Copy Markdown
Author

@kopalg20 kopalg20 Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made required changes. Let me know any further improvements needed.
Also added test cases for the same. @OrKoN

Copy link
Copy Markdown
Collaborator

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests and linter need to be fixed.

});
});

describe('ConsoleFormatter - Source Map & Heavy Error Tests', () => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these tests do not use any source maps. Can we also embed them into existing tests that already verify console message details and cover the list expectations there too?

@OrKoN
Copy link
Copy Markdown
Collaborator

OrKoN commented Feb 26, 2026

Closing as stale.

@OrKoN OrKoN closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants