Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Oct 30, 2025

Summary

fix ssr loadBundle inspect offset.

expect inspect console.log('load SSR'), but offset:

image

before:
image

after:
image

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings October 30, 2025 04:08
@netlify
Copy link

netlify bot commented Oct 30, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 5bcab23
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/6902fc8557e83700082d0696
😎 Deploy Preview https://deploy-preview-6464--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 (🟢 up 14 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 improves source mapping accuracy for CommonJS module execution by adjusting code wrapping and adding column offset configuration. It also makes the e2e test environment more flexible for debugging scenarios.

  • Modified code generation in CommonJsRunner to split code definition for better source mapping
  • Added columnOffset to vm.runInThisContext to correct stack traces
  • Made e2e test configuration conditional based on debugger presence and environment variables

Reviewed Changes

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

File Description
packages/core/src/server/runner/cjs.ts Refactored code wrapping to extract function definition and added columnOffset for accurate source mapping
e2e/cases/server/ssr/rsbuild.config.ts Added inspector-based writeToDisk configuration and made module output conditional on TEST_ESM_LIBRARY

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

@chenjiahan chenjiahan changed the title fix(ssr): loadBundle inspect offset fix(ssr): correct inspect offset when loading bundles Oct 30, 2025
@chenjiahan chenjiahan merged commit c3789d8 into main Oct 30, 2025
12 checks passed
@chenjiahan chenjiahan deleted the loadModule-inspect branch October 30, 2025 06:26
@chenjiahan chenjiahan mentioned this pull request Oct 30, 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.

3 participants