Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remix sourcemap upload cannot find @sentry/cli #9545

Closed
3 tasks done
fobos531 opened this issue Nov 13, 2023 · 6 comments · Fixed by getsentry/sentry-cli#1836
Closed
3 tasks done

Remix sourcemap upload cannot find @sentry/cli #9545

fobos531 opened this issue Nov 13, 2023 · 6 comments · Fixed by getsentry/sentry-cli#1836
Assignees
Labels
Package: remix Issues related to the Sentry Remix SDK Type: Bug

Comments

@fobos531
Copy link

fobos531 commented Nov 13, 2023

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'
}
@github-actions github-actions bot added the Package: remix Issues related to the Sentry Remix SDK label Nov 13, 2023
@lforst
Copy link
Member

lforst commented Nov 15, 2023

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

@fobos531
Copy link
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

@lforst
Copy link
Member

lforst commented Nov 17, 2023

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

@fobos531
Copy link
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.

@lforst
Copy link
Member

lforst commented Nov 20, 2023

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

@lforst
Copy link
Member

lforst commented Nov 22, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: remix Issues related to the Sentry Remix SDK Type: Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants