-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Vercel + Nextjs cannot find Sentry CLI binary #8659
Comments
I'm sharing my observations! Hope it's relevant and could help somebody. error screenshotenvironment
cause
temporary workaround
drawbacks of the workaround
possible fix
Give me a feedback if you need any further information or help. Thanks. |
Related to #8541 - closing so we can have convos there. |
Please check that your postinstall scripts are running when installing your dependencies |
I'm not entirely sure how to verify that. I'm using the default behavior for I'm inclined to think they're working as I believe turborepo would have errors if they weren't. |
@Xhale1 Please check if the In any case. Vercel caches builds and dependecies. Can you try rerunning a build without cache? There's a checkbox in Vercel for that. |
For any future googlers, this was our issue -- we had been using |
Just in case it helps others -- I was also having this issue and was able to resolve it by simply adding |
Explicitly adding |
For anybody still experiencing this issue: Unfortunately it is impossible to troubleshoot this without reproduction so it would be really cool if you could provide a small repo or stackblitz or similar so we can actually resolve this. |
I've setup a minimal reproduction here: https://github.com/thiemok/sentry-yarn-resolution-test |
Same issue on a pnpm workspaces project with Turborepo. Deployment on Vercel. Is there a manual command we can use to make sure the CLI is downloaded before the build script? Note: it works if I redeploy without cache. |
@baptisteArno This workaround worked for us. Add a manual run of the cli install script as the first part of your buildCommand:
|
Awesome, that works 🙌 |
Unfortunately that workaround seems to not work with yarn. I've added a pre build step to run This is then subsequently not found by the next build. I'm assuming thats because yarn pnp module resolution does not fall back to global npm packages. Deleting the |
Thinking about adding a step to just download the binary during the build.... |
Do you mean that if it doesn't find sentry-cli at build time, it downloads the sentry-cli binary from sentry's internal code? |
Yep. So when you build your app, in the case you would upload source maps, the SDK just downloads the binary if it is not there and then continues the build. |
@iforst Yes, I tried that too. Sorry I forgot to mention it. |
@saguilarolmo Hm that sucks. Just dumping a few things, please ignore if you already tried them:
|
Thank you very much @iforst!! |
What's the final solution here? I think this should remain open, disabling the build cache entirely is not a feasible long-term solution. |
@rdsedmundo You don't need to disable the build cache. Busting it once is enough. |
It works in my case, @lforst Should we add |
No this is not what we would want. |
My build works with But not with
|
@webjay What is the exact error message? |
This was build without cache. I also tried |
@webjay Do you have something in your logs about node_modules being installed? I assume you're on Vercel. |
@webjay Since you're using bun you need to add |
I have a similar problem to @webjay but I dont have the webpack error message. I'm switching an existing React project (custom webpack build) that used Sentry over to a next.js project (using default Next.js configs). I am an existing Sentry customer, and have done a number of integrations over the years, including with Nextjs. I used the @sentry/wizard npx tool to set up my integration. I was able to see the example API error in the sentry UI. When I start up my app, I get the "Can not find sentry CLI binary" message.
|
Why is this issue closed? I just tried integrating sentry. I don't have the webpack installed anywhere as mentioned in the linked issue before this issue here was closed. I also tried the manual cli installation recommendation without luck. Quite sure it's due to nextjs 14. But some more info here would be great. I just wasted 2 hours of time setting up a logging tool. It would at least be great if @sentry could confirm this issue here still persists and there are no ETAs for a fix in sight. In that case I could consider a temporary switch to another tool. It's quite urgent to get proper stacktraces setup. |
@bastiankistner Thank you for your concern. Trust me this is being looked at. I am also extremely annoyed by the persistence and frequency of this bug (because I have to keep explaining) and I keep bugging my manager to be able to allocate time to fix this. |
@bastiankistner I just got my setup working. Short answer: Long answer: Running I looked in Next, I removed all caches/build folders: Feeling a bit stumped at this point with no obvious differences (same version of node, next, typescript, @sentry/next), I tried simply uninstalling @sentry/next (via My next build succeeded with no config changes! So, perhaps there is some issue with existing projects when using the wizard to configure the sentry integration? I dont know. In any case, I hope this can help someone else. |
Sharing how I have solved this in case it's helpful anyhow, given I had this problem and commented here a few weeks ago:
I simply changed where the binary is saved to be inside the |
It works for me with @sentry/nextjs v7.33.0 and next v13.4.19, but I am unable to upgrade to next 14 without upgrading @sentry/nextjs. With the latest version of @sentry/nextjs, I get the sentry cli binary error. |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.60.1
Framework Version
Next 13.4.12 and react 18.2.0
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
Expected Result
Source maps are uploaded properly.
Actual Result
The sentry upload reports the following error:
error - Sentry CLI binary not found. Source maps will not be uploaded.
The text was updated successfully, but these errors were encountered: