Skip to content

SvelteKit + Vercel This Serverless Function has Crashed - Sentry CLI Binary? #9718

@Patrick-Ullrich

Description

@Patrick-Ullrich

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

7.84.0

Framework Version

@sveltejs/kit 1.20.4 svelte 3.59.2

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

Today all of our deploys to vercel started resulting in:
Screenshot 2023-11-30 at 16 53 09

The code change that first showed this was a 1 liner and we have tried rolling back to version that worked and we are getting the same issue.

I was going to log something with vercel, but when checking the logs we find the following 2 entries repeated over and over again on these PRs:

2023-11-30T22:47:11.201Z	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/@sentry/cli/js/helper.js:116:13)
    at Object.<anonymous> (/var/task/node_modules/@sentry/cli/js/helper.js:129:18)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at r.<computed>.e._load (/var/task/___vc/__launcher/__launcher.js:14:2516)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/var/task/node_modules/@sentry/cli/js/index.js:4:16)
INIT_REPORT Init Duration: 777.12 ms	Phase: init	Status: error	Error Type: Runtime.ExitError
2023-11-30T22:47:12.447Z	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/@sentry/cli/js/helper.js:116:13)
    at Object.<anonymous> (/var/task/node_modules/@sentry/cli/js/helper.js:129:18)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at r.<computed>.e._load (/var/task/___vc/__launcher/__launcher.js:14:2516)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/var/task/node_modules/@sentry/cli/js/index.js:4:16)
INIT_REPORT Init Duration: 1188.16 ms	Phase: invoke	Status: error	Error Type: Runtime.ExitError
Error: Runtime exited with error: exit status 1

as well as a simple

[GET] / status = 500 which I believe is just related to above.

Tried upgrading sentry sdks with no luck. The only way to recover our project was by completely removing sentry. Project is back up now. We got a seperate PR up now trying to add sentry back in but we keep getting above error.

I found some potentially related errors but they seem to be related to webpack / nextjs rather than vite and svelte:
#8659
#9584

Based on some ideas here: getsentry/sentry-cli#1317

I tried some random stuff like overwriting the Install command in vercel with:
npm uninstall @sentry/sveltekit && npm install @sentry/sveltekit && npm install
using SvelteKit(v1) preset, but no luck.

Not to add too much noice, but I figured this be worth logging given it just started breaking without any clear reason on why.

Project is in a monorepo using turborepo, npm workspace, other projects (node and next) all use sentry without issues.

Expected Result

Should be able to deploy sentry + sveltekit to vercel

Actual Result

Unable to deploy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: browserIssues related to the Sentry Browser SDK

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions