Skip to content

Conversation

@vzaidman
Copy link

@vzaidman vzaidman commented Aug 4, 2025

Summary

Stack trace lines were display: inherit which was causing them to be inline which was allowing errors to be concatenated.

So for the code:

      const error = new Error('error');
      const errorWithStringCause = new Error('error with string cause', {
        cause: 'string cause',
      });
      const errorWithErrorCause = new Error('error with error cause', {
        cause: error,
      });

      console.info('1. two regular errors as two args:');
      console.error(error, error);

      console.info('2. an error after an error with string cause:');
      console.error(errorWithStringCause, error);

      console.info('3. an error after an error with error cause:');
      console.error(errorWithErrorCause, error);

We've got the first console print like so:
Screenshot 2025-08-04 at 16 29 36

However it was only happening for when the ignored frames were displayed. Otherwise it was acting as expected:
Screenshot 2025-08-04 at 16 24 44

It was also acting as expected if there was any cause for the error:
Screenshot 2025-08-04 at 16 24 40

Test plan

After the fix, stack frames never have an error printed in the same line (inline):

  • Collapsed ignore frames:
Screenshot 2025-08-04 at 16 28 09
  • Displayed ignore frames:
Screenshot 2025-08-04 at 16 27 19
  • This change maintains backwards compatibility with previous Local Storage data (if modifying settings, experiments, or other persisted client state).

Upstreaming plan

@meta-cla meta-cla bot added the cla signed label Aug 4, 2025
@vzaidman vzaidman force-pushed the make-stack-traces-not-inline branch 2 times, most recently from c24ec63 to 982f207 Compare August 5, 2025 12:11
Copy link
Member

@huntie huntie left a comment

Choose a reason for hiding this comment

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

Awesome 🙌🏻

…line is always added between them and other printed elements
@vzaidman vzaidman force-pushed the make-stack-traces-not-inline branch from 982f207 to 87b91d6 Compare August 6, 2025 07:52
@vzaidman vzaidman merged commit e87564a into main Aug 6, 2025
5 checks passed
@vzaidman
Copy link
Author

vzaidman commented Jan 5, 2026

Upstreamed as https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6819066

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants