-
-
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
ERROR Cannot find module '@sentry/utils'
breaking Vercel deployments
#10429
Comments
integrations should use utils package as usual. Were you able to replicate this locally? Does clearing the vercel caching work? |
We reverted to |
I tested in Vercel myself with basic SvelteKit app and couldn't reproduce, so going to close this for now, we'll need a reproduction to dig in further. If anyone else experiences this please reach out, we can re-open the issue and take a look. Thanks! |
I’m also hitting this with a sveltekit app — fails consistently on every second or third deployment, not reproducible locally. Same error, that @sentry/utils can’t be found, using a pnpm monorepo with sentry in a shared package if that helps. Also did nothing other than updating packages. Completely breaks our app in production, and should be reopened. I’ve had to remove all traces of Sentry in the meantime. |
@madeleineostoja please share your sveltekit, vite and sdk version so we can try and reproduce it!
This makes me feel like it's a caching issue, either because of vercel or pnpm or both. If you run |
Versions:
My full dependency graph for
|
EDIT: I lied, issue has resurfaced. Again I changed nothing to do with sentry, and again redeploying the same build can fix it, suggesting a caching issue with Sentry + Vercel. Also worth noting I use Turborepo with Vercel's remote caching, and forcing a redeployment busts this remote cache. I'd suspect something going on there, but I haven't had time to nail down a consistent repro, especially since this is effecting the uptime of our production app, I just need it to work and can't be experimenting. |
Package caching is unfortunately not something we can influence from within our packages. All we can do is declare our dependencies carefully and correctly (which I believe we do). Please check the behaviour of your build tooling and let us know if you have any concrete suspicions that we are doing something wrong! |
Only suspicion is that sentry is the only package this happens for out of the dozens and dozens I have installed, and it seems I’m not the only one. Happy to just leave sentry out of my stack, it’s not the first production breaking bug I’ve had with these SDKs |
@madeleineostoja Totally fair. I'd personally rather blame pnpm than Sentry here but your technical decisions are up to you. |
Got a similar error for We're using pnpm and have a turborepo setup. |
@ludwighogstrom can you share more of the error? Is there a stack trace? More information? Thank you! |
Here is the stack trace
In the test we're importing
However, there are other tests that breaks in the same way where we don't import Everything seems to work fine otherwise. It's only when running Jest we have spotted the error. Not sure if it's related, but we have followed a "guide" from MSW to solve another Stack trace
The guide: Not sure if worth mention but in this test we have the
The solution from the "guide"
...could maybe affect how Sentry gets imported? |
@ludwighogstrom My mental pattern matching makes me think that this is less an issue with the SDK but jest resolving (or rather your setup thereof). Since it is very hard to debug without having the setup, would you mind sharing a reproduction example? |
I see! Not sure how easy that would be... let's see if I have the time later today to look into that. Added some more info in my comment above. Could potentially be several libraries/configurations that causes the problem (making it hard to know what to pick for a minimal reproduction 😅). |
Ah, we definitely use export conditions in the SDKs package.json, it's possible that that will mess up your module resolution. Unfortunately, I don't think this is something we will be able to fix from within the SDK meaning that this is something msw should change. Maybe you can somehow configure msw to be resolved in a specific way, then you can get rid of this export condition override. |
Thanks! Will look into that. Some comments in the MSW thread points out that their suggested solution is a bit blunt. Focusing on solving that instead of creating minimal reproduction. Sorry for hijacking this issue :) |
Hi, this issue has been stale for a while now. I've added the
|
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
7.98.0
Framework Version
7.98.0
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
We upgraded from 7.91.0 to 7.98.0 today and encountered breaking Vercel deployments:
The stack trace clearly points to
captureconsole.js
which made it clear for me that switching fromCaptureConsole
class tocaptureConsoleIntegration
led to the breakage.Expected Result
Vercel deployments should work as normal
Actual Result
The text was updated successfully, but these errors were encountered: