Skip to content

Commit cff56b6

Browse files
fix(build): normalize Windows backslash paths for sourcemap resolution (#714)
## Summary - Normalize Windows backslashes (`\`) to forward slashes (`/`) in the telemetry `beforeSend` hook so frame paths match uploaded sourcemap artifact URLs - Normalize the sourcemap `sources` array during debug ID injection so bundlers on Windows produce consistent paths Fixes https://sentry.sentry.io/issues/7402821077/ ## Problem On Windows, Bun compiled binaries resolve `Error.stack` frame paths with backslashes (e.g., `dist-bin\bin.js`). The `ensureAbsolute()` function in `telemetry.ts` prepended `/` but didn't convert backslashes, producing `/dist-bin\bin.js`. The Sentry symbolicator couldn't match this to the uploaded artifact at `~/dist-bin/bin.js`, so sourcemaps were never applied — stack traces showed minified function names like `ut` with no source context. ## Changes - **`src/lib/telemetry.ts`**: Add `.replaceAll("\\", "/")` in `ensureAbsolute()` before the relative-path check. Covers `frame.filename`, `frame.abs_path`, and `debug_meta.images[].code_file`. - **`src/lib/sourcemap/debug-id.ts`**: Normalize `sources` array to forward slashes after parsing the sourcemap JSON. Benefits both the CLI's own build and user-facing `sentry sourcemap inject`. - **`test/script/debug-id.test.ts`**: Two new test cases for backslash normalization in `sources` and forward-slash preservation. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent f7f4d71 commit cff56b6

23 files changed

Lines changed: 96 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
skill:
4343
- 'src/**'
4444
- 'docs/**'
45+
- 'package.json'
4546
- 'script/generate-skill.ts'
4647
- 'script/generate-command-docs.ts'
4748
- 'script/eval-skill.ts'

plugins/sentry-cli/skills/sentry-cli/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: sentry-cli
3-
version: 0.26.0
3+
version: 0.27.0-dev.0
44
description: Guide for using the Sentry CLI to interact with Sentry from the command line. Use when the user asks about viewing issues, events, projects, organizations, making API calls, or authenticating with Sentry via CLI.
55
requires:
66
bins: ["sentry"]

plugins/sentry-cli/skills/sentry-cli/references/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: sentry-cli-api
3-
version: 0.26.0
3+
version: 0.27.0-dev.0
44
description: Make an authenticated API request
55
requires:
66
bins: ["sentry"]

plugins/sentry-cli/skills/sentry-cli/references/auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: sentry-cli-auth
3-
version: 0.26.0
3+
version: 0.27.0-dev.0
44
description: Authenticate with Sentry
55
requires:
66
bins: ["sentry"]

plugins/sentry-cli/skills/sentry-cli/references/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: sentry-cli-cli
3-
version: 0.26.0
3+
version: 0.27.0-dev.0
44
description: CLI-related commands
55
requires:
66
bins: ["sentry"]

plugins/sentry-cli/skills/sentry-cli/references/dashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: sentry-cli-dashboard
3-
version: 0.26.0
3+
version: 0.27.0-dev.0
44
description: Manage Sentry dashboards
55
requires:
66
bins: ["sentry"]

plugins/sentry-cli/skills/sentry-cli/references/event.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: sentry-cli-event
3-
version: 0.26.0
3+
version: 0.27.0-dev.0
44
description: View and list Sentry events
55
requires:
66
bins: ["sentry"]

plugins/sentry-cli/skills/sentry-cli/references/init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: sentry-cli-init
3-
version: 0.26.0
3+
version: 0.27.0-dev.0
44
description: Initialize Sentry in your project (experimental)
55
requires:
66
bins: ["sentry"]

plugins/sentry-cli/skills/sentry-cli/references/issue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: sentry-cli-issue
3-
version: 0.26.0
3+
version: 0.27.0-dev.0
44
description: Manage Sentry issues
55
requires:
66
bins: ["sentry"]

plugins/sentry-cli/skills/sentry-cli/references/log.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: sentry-cli-log
3-
version: 0.26.0
3+
version: 0.27.0-dev.0
44
description: View Sentry logs
55
requires:
66
bins: ["sentry"]

0 commit comments

Comments
 (0)