Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Update source map parsing logic to properly handle paths relative to source map location.

From https://sourcemaps.info/spec.html:

If the sources are not absolute URLs after prepending of the “sourceRoot”, the sources are resolved relative to the SourceMap (like resolving script src in a html document).

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings October 28, 2025 03:09
@netlify
Copy link

netlify bot commented Oct 28, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 6fd8278
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/690033dc95cb67000853d8f3
😎 Deploy Preview https://deploy-preview-6452--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: 54 (🔴 down 2 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 fixes source map path handling to correctly resolve relative source paths according to the source maps specification. The fix ensures that relative source paths in source maps are resolved relative to the source map file's location rather than the dist directory.

Key Changes:

  • Modified parseFrame to return both the source map path and original position
  • Updated resolveSourceRelativeToRoot to resolve relative paths from the source map's directory instead of the dist directory
  • Adjusted test case to verify correct behavior with source paths relative to source map location

Reviewed Changes

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

File Description
packages/core/src/server/browserLogs.ts Updated source map resolution logic to use source map path as base for relative sources
e2e/cases/browser-logs/custom-source-map/index.test.ts Updated test to verify relative path resolution from source map location

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

@chenjiahan chenjiahan merged commit f1eb071 into main Oct 28, 2025
12 checks passed
@chenjiahan chenjiahan deleted the browser_logs_relative_1028 branch October 28, 2025 03:18
@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.

2 participants