Skip to content

fix(remix): Use npx @sentry/remix --upload-sourcemaps instead of sentry-upload-sourcemaps to avoid global bin collisions#1261

Merged
s1gr1d merged 2 commits intomasterfrom
sig/remix-script-change
Apr 29, 2026
Merged

fix(remix): Use npx @sentry/remix --upload-sourcemaps instead of sentry-upload-sourcemaps to avoid global bin collisions#1261
s1gr1d merged 2 commits intomasterfrom
sig/remix-script-change

Conversation

@s1gr1d
Copy link
Copy Markdown
Member

@s1gr1d s1gr1d commented Apr 21, 2026

@s1gr1d s1gr1d requested review from chargome and mydea April 21, 2026 15:18
…entry-upload-sourcemaps` to avoid global bin collisions
@s1gr1d s1gr1d changed the title fix(remix): Update sentry-upload-sourcemaps command to use npx --package=@sentry/remix fix(remix): Use npx @sentry/remix --upload-sourcemaps instead of sentry-upload-sourcemaps to avoid global bin collisions Apr 29, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3c4097b. Configure here.

Comment thread src/remix/sdk-setup.ts

const instrumentedBuildCommand =
`${buildCommand} --sourcemap && sentry-upload-sourcemaps --org ${args.org} --project ${args.project}` +
`${buildCommand} --sourcemap && npx @sentry/remix --upload-sourcemaps --org ${args.org} --project ${args.project}` +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong npx invocation syntax for scoped package binary

High Severity

The command uses npx @sentry/remix --upload-sourcemaps but the @sentry/remix package's bin field defines the binary as sentry-upload-sourcemaps, not remix. When npx resolves a scoped package, it looks for a binary matching the unscoped name (remix), which doesn't exist. The PR title itself says to use npx --package=@sentry/remix, and the correct syntax is npx --package=@sentry/remix sentry-upload-sourcemaps. The generated build scripts will fail at runtime.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3c4097b. Configure here.

Copy link
Copy Markdown
Member Author

@s1gr1d s1gr1d Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We explicitly want to change this. As @sentry/remix only has one bin script, it will just call the one, regardless of the name. I tested the command and it works

Comment thread src/remix/sdk-setup.ts
Comment on lines +337 to 338
`${buildCommand} --sourcemap && npx @sentry/remix --upload-sourcemaps --org ${args.org} --project ${args.project}` +
(args.url ? ` --url ${args.url}` : '') +
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The generated npx command for sourcemap upload is incorrect. It uses npx @sentry/remix --upload-sourcemaps instead of the correct npx --package=@sentry/remix sentry-upload-sourcemaps.
Severity: HIGH

Suggested Fix

Change the generated command to use the correct npx syntax for running a binary from a package without installing it: npx --package=@sentry/remix sentry-upload-sourcemaps --org ... --project ....

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/remix/sdk-setup.ts#L337-L338

Potential issue: The code generates an incorrect `npx` command, `npx @sentry/remix
--upload-sourcemaps ...`, and writes it into the user's `package.json` file. This
command will fail because `npx @sentry/remix` attempts to execute a binary named `remix`
from the `@sentry/remix` package, which does not exist. The correct binary is
`sentry-upload-sourcemaps`. As a result, the sourcemap upload step will silently fail
for all users who rely on the Remix wizard for setup, hindering debugging in production.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we explicitly want to change this. As @sentry/remix only has one bin script, it will just call the one, regardless of the name

@s1gr1d s1gr1d merged commit 5291926 into master Apr 29, 2026
56 checks passed
@s1gr1d s1gr1d deleted the sig/remix-script-change branch April 29, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants