Repository navigation
Description
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: vite@8.3.8, nanoid@5, @sentry/vite-plugin@11.17.0.
Steps to Reproduce
- On Windows, run
npx vite buildwith upload credentials (I used a local mock of the Sentry API viaurl, and captured thechunk-uploadbody). - Compare
sourcesin the map Vite wrote (dist/assets/*.js.map) withsourcesin 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/vite-plugin@11.14.0 (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:
defaultRewriteSourcesHookin@sentry/bundler-plugins(build/esm/core/debug-id-upload.js, unchanged from 11.14.0 to 11.17.0) returnspath.relative(process.cwd(), path.normalize(source)). On Windows,path.normalizeandpath.relativereturn backslash paths, so everysourcesentry in the staged upload copy gets backslashes.- Until 11.16.0 this was hidden. The
sentryCLI's injection step convertssourcesback withreplaceAll("\\", "/"), 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 thesentryCLI range allows 0.50.0 #26658; the uploaded chunk above has 6_sentryDebugIdsoccurrences 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.
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsWaiting for: Product Owner
Activity
linear-code commentedon Nov 23, 2026
JS-4148