sentry-javascript
sentry-javascript copied to clipboard
Too many deployments created with Next.js
Environment
What version are you running? Etc.
@sentry/nextjs
: 7.12.1
Steps to Reproduce
- Set up a Next.js project with Sentry (you can use Next.js' example)
- Enable Vercel + Sentry integration
- Update
next.config.js
as this file - Add
.env
file with the following values (don't forget to update the values with yours):
VERCEL="1"
VERCEL_ENV="development"
SENTRY_AUTH_TOKEN="your-auth-token"
NEXT_PUBLIC_SENTRY_DSN="your-dsn"
SENTRY_PROJECT="your-project"
SENTRY_ORG="your-org"
- Run
yarn build
Expected Result
Only one deployment should show up on the Sentry release page.
Actual Result
In total 3 deployments are created by the webpack plugin for each time the project builds on Vercel. There should be only one. This results in people being notified by email 3 times each time there's a new release.

P.S.: Is there any reason why deployments are not enabled by default by @sentry/nextjs
? It was hard to find why releases are not tagged with an environment.
Setting runOnce
to true
solves the issue, but then not all source maps are uploaded to Sentry.
BTW the runOnce
property is not documented on the project's REAMD.md file.
Huh. Three is surprising to me. Two would make sense (one for backend, one for frontend), but off the top of my head I can't think where the third would be coming from. Can you please post a link to the page you took the screenshot from?
That said, whether it's three or two, you're right that we could be smarter about this. I'm going to move this issue to the SDK repo and put fixing that in our backlog.
In the meantime, though, I'll answer your question with one of my own: What's your use-case which needs deploys over and above releases? As you point out, they should have a one-to-one relationship (which is precisely why we don't enable them by default).
@lobsterkatie, here's the link to that page: https://sentry.io/organizations/igor-gassmann-temporary/releases/aeef930315afb20193e8d1f646b13f455adef0c6/?project=6712309
What's you use-case which needs deploys over and above releases?
We're using deployments so that releases are properly tagged with an environment (e.g. production
). If we don't do that, releases only get tagged with an environment if it receives session data which doesn't always happen since the time between two releases can be too short to allow it.
I have it triggered 6 times.
@lobsterkatie shouldn't the type of this issue be a bug?
I have it triggered 6 times.
6? That's even more of a mystery! Is your release value maybe not getting updated?
@lobsterkatie shouldn't the type of this issue be a bug?
Enh? I guess it's really both. The improvement is not creating separate deploys for the frontend and backend builds. The bug is the fact that there are more than 2 getting created.
Sorry I haven't had a chance to dig into this yet.
Closing this issue for cleanup. Please re-open if this still applies. Thanks!