GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `@sentry/vite-plugin`: uploaded source maps have backslash `sources` on Windows since 11.16.0 (`sentry` CLI 0.50.0) · Issue #26788 · getsentry/sentry-javascript

@sentry/vite-plugin: uploaded source maps have backslash sources on Windows since 11.16.0 (sentry CLI 0.50.0) #26788

New issue
Copy link
New issue
Copy link
Done
#26792
Done
@sentry/vite-plugin: uploaded source maps have backslash sources on Windows since 11.16.0 (sentry CLI 0.50.0)#26788
#26792
Copy link
Assignees
chargome
Labels
Feature: Source Maps

Description

@cr101
cr101
opened on Nov 23, 2026
Issue body actions

Is there an existing issue for this?

  • I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • I have reviewed the documentation https://docs.sentry.io/
  • I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/vite-plugin

SDK Version

11.17.0 (also 11.16.0; sentry CLI 0.50.0)

Framework Version

Vite 8.3.8, Node.js 26.13.1, Windows 11 x64

Link to Sentry event

None. Reproduced against a local mock of the upload API; the issue is in the uploaded artifact bundle, before any event is processed.

Reproduction Example/SDK Setup

Minimal project (index.html loads src/main.js):

// src/main.js
import { nanoid } from 'nanoid'
document.body.textContent = nanoid()
// vite.config.js
import { defineConfig } from 'vite'
import { sentryVitePlugin } from '@sentry/vite-plugin'

export default defineConfig({
  build: { sourcemap: 'hidden' },
  plugins: [
    sentryVitePlugin({
      authToken: process.env.SENTRY_AUTH_TOKEN,
      org: process.env.SENTRY_ORG,
      project: process.env.SENTRY_PROJECT,
      release: { name: 'repro-1', setCommits: false, finalize: false },
    }),
  ],
})

Dependencies: [email protected], nanoid@5, @sentry/[email protected].

Steps to Reproduce

  1. On Windows, run npx vite build with upload credentials (I used a local mock of the Sentry API via url, and captured the chunk-upload body).
  2. Compare sources in the map Vite wrote (dist/assets/*.js.map) with sources in the uploaded artifact bundle's .js.map.

Expected Result

The uploaded map keeps URL-style sources with forward slashes, as Vite wrote them and as 11.14.0 uploaded them:

["../../node_modules/nanoid/url-alphabet/index.js", "../../node_modules/nanoid/index.browser.js", "../../src/main.js"]

Actual Result

With 11.16.0 / 11.17.0, the uploaded map's sources use Windows backslashes:

["..\\..\\node_modules\\nanoid\\url-alphabet\\index.js", "..\\..\\node_modules\\nanoid\\index.browser.js", "..\\..\\src\\main.js"]

The same project with @sentry/[email protected] (sentry CLI 0.49.0) uploads forward slashes. The map on disk (dist/assets) has forward slashes in both cases; only the uploaded copy differs.

The source map spec treats sources as URLs, so frames resolved from these maps carry Windows-style paths. Builds of the same commit on Windows and Linux produce different frame paths, and path-based features such as stack trace links (code mappings) expect /.

Additional Context

I believe the cause is two changes interacting:

  1. defaultRewriteSourcesHook in @sentry/bundler-plugins (build/esm/core/debug-id-upload.js, unchanged from 11.14.0 to 11.17.0) returns path.relative(process.cwd(), path.normalize(source)). On Windows, path.normalize and path.relative return backslash paths, so every sources entry in the staged upload copy gets backslashes.
  2. Until 11.16.0 this was hidden. The sentry CLI's injection step converts sources back with replaceAll("\\", "/"), and with CLI 0.49.0 that step always ran on Vite 8 output, because the CLI did not recognise the Oxc-minified debug-ID snippet and injected a second one (Vite 8 source maps are uploaded one line off until the sentry CLI range allows 0.50.0 #26658; the uploaded chunk above has 6 _sentryDebugIds occurrences at 11.14.0, against 3 at 11.17.0). CLI 0.50.0 (fix(deps): Bump the sentry CLI to ^0.50.0 #26662) recognises the existing snippet and returns early (wasInjected: false) before that conversion, so the backslashes from step 1 now reach the upload.

Possible fix: make defaultRewriteSourcesHook return POSIX separators, for example path.posix operations or .replace(/\\/g, '/') on the result, rather than relying on the CLI's injection step. That would also give user-supplied rewriteSources hooks consistent input.

Workaround: pass an identity hook, sourcemaps: { rewriteSources: (source) => source }. The uploaded map then keeps the forward-slash sources Vite wrote.

Activity

  1. getsantry
    added
    Waiting for: Product Owner
    on Nov 23, 2026
  2. linear-code commented on Nov 23, 2026

    @linear-code
    linear-codeBot
    on Nov 23, 2026 – with Linear Code
    More actions

    JS-4148

  3. getsantry
    added this to GitHub Issues with 👀 3on Nov 23, 2026
  4. getsantry
    moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Nov 23, 2026
  5. github-actions
    added
    Feature: Source Maps
    on Nov 23, 2026
  6. chargome
    self-assigned this
    on Nov 24, 2026
  7. chargome
    closed this as completedin 9a0dabbon Nov 24, 2026
  8. getsantry
    removed
    Waiting for: Product Owner
    on Nov 24, 2026
  9. pranav514
    added a commit that references this issue on Nov 24, 2026

    fix(bundler-plugins): Use forward slashes in rewritten source map sou…

    This issue will close once commit 9a0dabb is merged into the 'develop' branch.
    9a0dabb
  10. github-actions commented on Nov 25, 2026

    @github-actions
    github-actionsBot
    on Nov 25, 2026 – with GitHub Actions
    Contributor
    More actions

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #26792, which was included in the 11.18.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @chargome
    chargome

Labels

Feature: Source Maps

Projects

  • GitHub Issues with 👀 3
    Status
    Waiting for: Product Owner
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.