Skip to content

fix: exclude lazy compilation identifier from import traces#6740

Merged
chenjiahan merged 2 commits intomainfrom
import_trace_lazy_1209
Dec 10, 2025
Merged

fix: exclude lazy compilation identifier from import traces#6740
chenjiahan merged 2 commits intomainfrom
import_trace_lazy_1209

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

Filter lazy compilation identifier from module traces to clean up error reporting. Also update related test cases to verify the behavior.

Import traces (entry → error):
  ./src/index.js
- lazy-compilation-proxy|builtin:swc-loader??ruleSet[1].rules[4].use[0]!./dynamic.js
  ./src/dynamic.js ×

Checklist

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

Copilot AI review requested due to automatic review settings December 9, 2025 11:07
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 9, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 1418627
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/69380469d227350008eb562f
😎 Deploy Preview https://deploy-preview-6740--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: 69 (no change from production)
Accessibility: 100 (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.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copy link
Copy Markdown
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 improves error reporting by filtering out the lazy compilation identifier from module import traces. When lazy compilation is enabled, the proxy identifier (lazy-compilation-proxy) would previously appear in error traces, cluttering the output. The fix extracts this identifier as a constant and uses it consistently to filter traces in two locations.

Key Changes

  • Introduced LAZY_COMPILATION_IDENTIFIER constant to centralize the lazy compilation proxy string
  • Updated trace filtering logic in error formatting to exclude lazy compilation proxy modules
  • Added test case to verify the filtering behavior

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/core/src/constants.ts Defines new LAZY_COMPILATION_IDENTIFIER constant for consistent use across codebase
packages/core/src/provider/createCompiler.ts Updates lazy compilation detection to use the new constant instead of hardcoded string
packages/core/src/helpers/format.ts Filters out lazy compilation proxy from module traces to clean up error messages
e2e/cases/diagnostic/import-traces-lazy-compilation/src/index.js Test file with dynamic import to trigger lazy compilation
e2e/cases/diagnostic/import-traces-lazy-compilation/src/dynamic.js Test file with failing import to generate error traces
e2e/cases/diagnostic/import-traces-lazy-compilation/index.test.ts Test case verifying lazy compilation identifier exclusion from traces

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

Comment thread e2e/cases/diagnostic/import-traces-lazy-compilation/index.test.ts
@chenjiahan chenjiahan merged commit 272bd87 into main Dec 10, 2025
11 checks passed
@chenjiahan chenjiahan deleted the import_trace_lazy_1209 branch December 10, 2025 02:29
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