Skip to content

fix: respect errorStack option in stats output (#15980)#20258

Merged
alexander-akait merged 2 commits intowebpack:mainfrom
samarthsinh2660:fix/15980-errorStack-option
Dec 22, 2025
Merged

fix: respect errorStack option in stats output (#15980)#20258
alexander-akait merged 2 commits intowebpack:mainfrom
samarthsinh2660:fix/15980-errorStack-option

Conversation

@samarthsinh2660
Copy link
Contributor

Summary

Fixes #15980.

The errorStack extractor was not checking the errorStack option before adding stack traces to error output. This caused stack traces to be printed even when stats.errorStack was set to false.

This fix adds a check for the errorStack option, similar to how errorDetails checks its corresponding option.

What kind of change does this PR introduce?

fix

Did you add tests for your changes?

Yes. Added a regression test case:

  • test/statsCases/error-stack-disabled-error/

It verifies that when stats.errorStack: false is set, error stack traces are not included in the stats output.

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

No documentation changes.

@changeset-bot
Copy link

changeset-bot bot commented Dec 20, 2025

🦋 Changeset detected

Latest commit: fa6e5a7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@samarthsinh2660 samarthsinh2660 force-pushed the fix/15980-errorStack-option branch from d7ed708 to f665e32 Compare December 20, 2025 22:07
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 20, 2025

CodSpeed Performance Report

Merging #20258 will not alter performance

Comparing samarthsinh2660:fix/15980-errorStack-option (fa6e5a7) with main (3ae1004)

Summary

✅ 72 untouched

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Let's improve test cases

});
}
]
};
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a test case where we print stack trace, i.e. errorStack: true and we can merge, thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok let me add it

The errorStack extractor was not checking the errorStack option before
adding stack traces to error output. This caused stack traces to be
printed even when stats.errorStack was set to false.

This fix adds a check for the errorStack option, similar to how
errorDetails checks its corresponding option.

Added test cases for both errorStack: false and errorStack: true.
@alexander-akait alexander-akait merged commit 3bd18bb into webpack:main Dec 22, 2025
51 checks passed
@github-actions
Copy link
Contributor

This PR is packaged and the instant preview is available (3bd18bb).

Install it locally:

  • npm
npm i -D webpack@https://pkg.pr.new/webpack@3bd18bb
  • yarn
yarn add -D webpack@https://pkg.pr.new/webpack@3bd18bb
  • pnpm
pnpm add -D webpack@https://pkg.pr.new/webpack@3bd18bb

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.

Stacktraces are printed when errorStack is false

2 participants