Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Add errorStack: true to stats.toJson() to print compilation error stacks in debug mode:

image

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 11, 2025 06:28
@netlify
Copy link

netlify bot commented Nov 11, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit d524d80
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/6912d789a844ae0008c28e98
😎 Deploy Preview https://deploy-preview-6551--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 76 (🟢 up 8 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for printing compilation error stack traces when running in debug/verbose mode by configuring Rspack's stats.errorStack option.

Key changes:

  • Enabled errorStack in stats configuration when in verbose mode
  • Refactored error formatting to internalize verbose mode detection
  • Added test coverage for the new functionality

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/helpers/stats.ts Added errorStack: isVerbose() to stats options and removed the now-unused verbose parameter from formatStatsError calls
packages/core/src/helpers/format.ts Refactored formatStatsError to check verbose mode internally rather than accepting it as a parameter
e2e/helper/utils.ts Added enableDebugMode utility function to simplify enabling debug mode in tests
e2e/cases/diagnostic/add-compilation-errors/ New test case verifying error stack traces are shown in debug mode and hidden by default
e2e/cases/config/debug-mode/index.test.ts Refactored to use the new enableDebugMode helper for cleaner test code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit fe5e5d8 into main Nov 11, 2025
18 checks passed
@chenjiahan chenjiahan deleted the error_stack_1111 branch November 11, 2025 06:41
@chenjiahan chenjiahan mentioned this pull request Nov 12, 2025
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.

2 participants