Skip to content
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

with-sentry @sentry/webpack-plugin uploads previous build artifacts #14076

Closed
stovmascript opened this issue Jun 11, 2020 · 7 comments
Closed
Labels
examples Issue/PR related to examples good first issue Easy to fix issues, good for newcomers

Comments

@stovmascript
Copy link
Contributor

Bug report

Describe the bug

In the with-sentry example, when @sentry/webpack-plugin is used for automatic sourcemap upload, it will include previous builds to the upload.

To Reproduce

  1. Use the with-sentry example
  2. Configure the app for automatic sourcemap upload
  3. Run build multiple times
  4. You should see the upload size increasing

Expected behavior

Only include current build artifacts in the upload to Sentry.

System information

  • OS: macOS
  • Version of Next.js: 9.4.4
  • Version of Node.js: 12.16.1

Additional context

We're self hosting Sentry and in our case just a couple of builds of our app can result in a 500MB upload.

@jamesmosier jamesmosier added the good first issue Easy to fix issues, good for newcomers label Jul 10, 2020
@jamesmosier
Copy link
Contributor

Feel free to investigate and open up a PR 😄

@jamesmosier jamesmosier added the examples Issue/PR related to examples label Jul 10, 2020
@stovmascript
Copy link
Contributor Author

I dug around before opening the issue and it could be resolved quite easily. @sentry/webpack-plugin allows specifying which files to include, but it would be great if somebody could point me to a reliable source of build output files.

I looked into the build-manifest.json that gets generated and it could be useful, but the problem is that this file is generated after files are built and @sentry/webpack-plugin needs to be configured at build time.

@stovmascript
Copy link
Contributor Author

@jamesmosier That, or if there was somebody on the team or some doc that could help me understand the .next dir structure. I tried to observe how the dir changes across builds with build id, etc. I have some idea, but that still isn't helping me grab all needed build files (cached from previous builds & new ones).

@Multiply
Copy link

Not entirely related, but I had a similar issue when deploying to firebase, that all previous builds would be included.
I simply cleaned up the next directory before building and deploying production builds.

@stovmascript
Copy link
Contributor Author

@Multiply Yeah, that fixes the duplicity problem, but it's a workaround which potentially creates other problems. I would like to avoid it and definitely not something I would introduce to the with-sentry example. There's a whole RFC #6009 dedicated to build dir cleaning and it's still open.

@stovmascript
Copy link
Contributor Author

This seems to be solved in Next.js 11, with the new distDir cleaning. You can also now use the official @sentry/nextjs SDK (example).

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants