From 2928476e71e350b0af35fe84df1a0fcbc90336fe Mon Sep 17 00:00:00 2001 From: Steven Enamakel <31011319+senamakel@users.noreply.github.com> Date: Sat, 9 May 2026 19:53:44 -0700 Subject: [PATCH] fix(sentry): resolve verifier path correctly on Windows (#1452) --- scripts/release/verify-sentry-sourcemaps.mjs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/release/verify-sentry-sourcemaps.mjs b/scripts/release/verify-sentry-sourcemaps.mjs index d97b3efe0..977ccbbc6 100755 --- a/scripts/release/verify-sentry-sourcemaps.mjs +++ b/scripts/release/verify-sentry-sourcemaps.mjs @@ -14,9 +14,15 @@ // ran — either a `// debugId=` pragma comment OR an injected // `_sentryDebugIds` runtime map. import { readdirSync, readFileSync, statSync } from 'node:fs'; -import { join, resolve } from 'node:path'; +import { dirname, join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; -const ROOT = resolve(new URL('..', import.meta.url).pathname, '..'); +// Use `fileURLToPath` rather than `new URL(...).pathname` — on Windows the +// latter returns a leading-slash path like `/D:/a/openhuman/...` which +// `path.resolve` then mangles into `D:\D:\a\...` (duplicate drive letter), +// causing the verifier to ENOENT on `dist/assets`. +const HERE = dirname(fileURLToPath(import.meta.url)); +const ROOT = resolve(HERE, '..', '..'); const ASSETS = join(ROOT, 'app', 'dist', 'assets'); // The pragma comment `//# debugId=` is what @sentry/vite-plugin // appends to chunks, but Vite/esbuild minification strips it from many