sentry-cli: Vercel build errors in runtime due to Sentry CLI binary for arch not found
Environment
@sentry/cli v2.22.3 on Ubuntu 23.10
Steps to Reproduce
When attempting to upgrade @sentry/sveltekit from 7.76.0 to 7.83.0, we encounter this runtime error on a Vercel preview deployment URL:
2023-11-29T18:38:58.472Z undefined ERROR Error: Sentry CLI binary for this platform/architecture not found!
It seems like none of the "@sentry/cli" package's optional dependencies got installed. Please make sure your package manager is configured to install optional dependencies. If you are using npm to install your dependencies, please don't set the "--no-optional" or "--omit=optional" flags. Sentry CLI needs the "optionalDependencies" feature in order to install its binary.
at getBinaryPath (/var/task/node_modules/.pnpm/@sentry+cli@2.22.3/node_modules/@sentry/cli/js/helper.js:116:13)
at Object.<anonymous> (/var/task/node_modules/.pnpm/@sentry+cli@2.22.3/node_modules/@sentry/cli/js/helper.js:129:18)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at r.<computed>.e._load (/var/task/___vc/__launcher/__launcher.js:14:2516)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at Object.<anonymous> (/var/task/node_modules/.pnpm/@sentry+cli@2.22.3/node_modules/@sentry/cli/js/index.js:4:16)
INIT_REPORT Init Duration: 977.05 ms Phase: invoke Status: error Error Type: Runtime.ExitError
RequestId: 9b0d05a2-8a1e-4975-b480-92d551a0cf9e Error: Runtime exited with error: exit status 1
Runtime.ExitError
The issue is most likely related to https://github.com/getsentry/sentry-cli/releases/tag/2.22.3
The package manager in use is pnpm, optional dependencies are not disabled, and the .npmrc file looks as follows:
engine-strict=true
enable-pre-post-scripts=true
strict-peer-dependencies=true
update-notifier=false
Expected/Actual Result
Deployment should work as usual
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Reactions: 14
- Comments: 28 (8 by maintainers)
Links to this issue
Commits related to this issue
- fix: bad sentry dep on vercel https://github.com/getsentry/sentry-cli/issues/1849 — committed to wpdecoupled/wpgraphql-repl by moonmeister 7 months ago
- Merge branch 'main' into gql-query-save * main: fix: make resolution work fix: bad sentry dep on vercel https://github.com/getsentry/sentry-cli/issues/1849 Revert "chore: major version updates ... — committed to wpdecoupled/wpgraphql-repl by moonmeister 7 months ago
- Downgrade @sentry/cli to try and work around getsentry/sentry-cli#1849 — committed to MongooseMoo/react-client by ctoth 6 months ago
- Disable sentry until getsentry/sentry-cli#1849 is fixed — committed to joshnuss/hypersonic by joshnuss 6 months ago
We’ve pinged Vercel about this. I’ll see if I can find a workaround for this this week.
We’ve released a new version of the CLI
2.23.2which includes a change that may solve the missing binary for Vercel deployments. The package will now include a post-install script that tries to manually download the binary when it cannot find the relevant optional dependency including the binary. This is very similar to what esbuild does for its binary.Please try it out and let me know if it solved the issue for you.
+1 a bummer as both a paid sentry and vercel user
if nothing, a guide on a workaround is expected at the very least.
Sveltekit 2 users would need to downgrade the framework to fix this issue. Is there anyone working on this? Also, naive question: why is the cli being used in a production client/server build?
Update: I’ve tried the fix noted above that pins
@sentry/clito2.22.2but no dice. I’ve downgraded to SK 1 and reverted all the functionality introduced in the newer versions of the Sentry SDK but I just can’t make it work. Like @ni-co above, I can build, but running on Vercel just fails.Probably gonna give up here.
@knd775 I’ve pinged them on slack but I believe Vercel is on company holiday until the end of the year. I’d prefer if we keep communication about this in the public in any case (i.e. over at https://github.com/vercel/nft/issues/371).
We’re also facing this issue. The workaround has been to peg “@sentry/cli”: “2.22.2”. Deploys using “@sentry/sveltekit”: “^7.84.0”, and previous versions were successful by locking this version.
@alexbjorlig
In your package.json add:
Then either:
a. delete your
package-lock.json. If your app and dependencies are typically ok with being brought up to latest versions then this is an OK route. My app is still in beta and has a short dependency list, so this was easiest. b. manually update your package-lock.json file to create matching entries for@sentry/cli. If you have an older app that has accumulated a specific dependency list and you have issues upgrading packages sometimes, this might be the better avenue.Then re-run
npm install(or yarn, or whatever you’re using)Someone pointed me here. I’m running SvelteKit + Sentry + Vercel without issue right now. My package manager is
yarn.Here are some excerpts from
package.jsonand
yarn.lockLet me know if that helps or, I’m happy to post more details about our setup
This issue should be fixed with the newest version of the
@sentry/clipackage. Let us know if this is not the case.@lforst can confirm, updating to
"@sentry/sveltekit": "^7.91.0",enabled us to deploy to vercel again.EDIT: Since there might be difference between npm / yarn / pnpm: We are using npm 9.x