Skip to content

Remix sourcemap upload cannot find @sentry/cli #9545

Closed
getsentry/sentry-cli
#1836

Description

@fobos531

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/remix

SDK Version

7.80.0

Framework Version

Remix 2.2.0

Link to Sentry event

No response

SDK Setup

 Sentry.init({
    dsn: 'REDACTED',
    tracesSampleRate: 1,
    replaysSessionSampleRate: 0.1,
    replaysOnErrorSampleRate: 1,
    enabled: getEnv().REMIX_ENV !== 'development',
    environment: getEnv().REMIX_ENV,
    tunnel: '/api/tunnel',

    integrations: [
      new Sentry.BrowserTracing({
        routingInstrumentation: Sentry.remixRouterInstrumentation(useEffect, useLocation, useMatches),
      }),
      new Sentry.Replay(),
    ],
  });

Steps to Reproduce

  1. Initialize a sample project with Remix
  2. Run the sentry wizard
  3. Try uploading the sourcemaps via npx remix build --sourcemap && npx sentry-upload-sourcemaps --org MyOrg --project MyProj

Expected Result

The sourcemaps upload should work fine.

Actual Result

Error: Command failed: /Users/jakovglavina/Posao/REDACTED/web/node_modules/@sentry/cli/sentry-cli sourcemaps inject public/build
/bin/sh: /Users/jakovglavina/Posao/REDACTED/web/node_modules/@sentry/cli/sentry-cli: No such file or directory

    at checkExecSyncError (node:child_process:885:11)
    at execSync (node:child_process:957:15)
    at injectDebugId (/Users/jakovglavina/Posao/REDACTED/web/node_modules/@sentry/remix/scripts/injectDebugId.js:10:5)
    at Object.<anonymous> (/Users/jakovglavina/Posao/REDACTED/web/node_modules/@sentry/remix/scripts/sentry-upload-sourcemaps.js:71:3)
    at Module._compile (node:internal/modules/cjs/loader:1226:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
    at Module.load (node:internal/modules/cjs/loader:1089:32)
    at Module._load (node:internal/modules/cjs/loader:930:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  status: 127,
  signal: null,
  output: [
    null,
    <Buffer >,
    <Buffer 2f 62 69 6e 2f 73 68 3a 20 2f 55 73 65 72 73 2f 6a 61 6b 6f 76 67 6c 61 76 69 6e 61 2f 50 6f 73 61 6f 2f 62 32 67 2d 63 6f 6e 73 75 6c 74 69 6e 67 2f ... 71 more bytes>
  ],
  pid: 38153,
  stdout: <Buffer >,
  stderr: <Buffer 2f 62 69 6e 2f 73 68 3a 20 2f 55 73 65 72 73 2f 6a 61 6b 6f 76 67 6c 61 76 69 6e 61 2f 50 6f 73 61 6f 2f 62 32 67 2d 63 6f 6e 73 75 6c 74 69 6e 67 2f ... 71 more bytes>
}
[sentry] Failed to propose a release version.
[sentry] You can specify a release version with `--release` flag.
[sentry] For example: `sentry-upload-sourcemaps --release 1.0.0`
node:internal/errors:490
    ErrorCaptureStackTrace(err);
    ^

Error: spawn /Users/jakovglavina/Posao/REDACTED/web/node_modules/@sentry/cli/sentry-cli ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /Users/jakovglavina/Posao/REDACTED/web/node_modules/@sentry/cli/sentry-cli',
  path: '/Users/jakovglavina/Posao/REDACTED/web/node_modules/@sentry/cli/sentry-cli',
  spawnargs: [ 'releases', 'propose-version' ],
  cmd: '/Users/jakovglavina/Posao/REDACTED/web/node_modules/@sentry/cli/sentry-cli releases propose-version'
}

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀on Nov 13, 2023
  2. lforst commented on Nov 15, 2023

    @lforst
    Contributor

    Hi, can you try running sentry-upload-sourcemaps without npx? Thanks!

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀on Nov 15, 2023
  4. fobos531 commented on Nov 17, 2023

    @fobos531
    Author

    Hi, can you try running sentry-upload-sourcemaps without npx? Thanks!

    Hi! This just reports back with

    zsh: command not found: sentry-upload-sourcemaps

  5. moved this to Waiting for: Product Owner in GitHub Issues with 👀on Nov 17, 2023
  6. lforst commented on Nov 17, 2023

    @lforst
    Contributor

    You likely need to run it with your package manager, not npx.

  7. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀on Nov 17, 2023
  8. fobos531 commented on Nov 18, 2023

    @fobos531
    Author

    You likely need to run it with your package manager, not npx.

    My current package manager is Bun. I'm receiving the same issue with their equivalent which is bunx.

  9. moved this to Waiting for: Product Owner in GitHub Issues with 👀on Nov 18, 2023
  10. lforst commented on Nov 20, 2023

    @lforst
    Contributor

    Ok if you use bun you need to add @sentry/cli as a trusted dependency so that postinstall scripts run: https://bun.sh/guides/install/trusted

  11. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀on Nov 20, 2023
  12. lforst commented on Nov 22, 2023

    @lforst
    Contributor

    Well be sustainably fixing this though in the near future so you don't have to jump through hoops like this.

  13. self-assigned this
    on Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions