-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(nextjs): Add widenClientFileUpload
option
#4827
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
feat(nextjs): Add widenClientFileUpload
option
#4827
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/sentry/sentry-docs/688hU7utRAyCFxjxEQedeWSnviJa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Katie, the new section reads excellent and also explains our intention behind the added option really well.
I also peeked over at getsentry/sentry-javascript#4705 and the changes there also LGTM. (love the tests)
I have one tiny nit but consider this PR approved: widenClientFileUpload
doesn't explain too well what it does. The main question I would have while seeing this option for the first time would be: To what scale am I widening the file upload? What files are now included?
However, nobody is gonna use this option unless they have read the documentation behind it, so I don't think it really matters.
Yup, I can see what you mean, but I don't see a way to make it more specific without the option name being a dozen words long, LOL. I think that in this case, as you say, context clues will carry the day. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small wording stuff, but otherwise fine. If you don't like the suggestion I made for replacing "tell...apart", let me know and we can figure out something better.
When nextjs builds an app, compiled versions of each page end up in `.next/static/chunks/pages`. In some circumstances, however, user-generated code ends up outside of `pages/`, and in those cases sourcemaps are broken because the relevant files aren't being uploaded. This fixes that by optionally widening the scope of the upload, while excluding files known to contain only nextjs and webpack code. (Every build will generate other files which should be excluded, but there's no way to tell in advance what they're going to be called.) In order to reduce the number of irrelevant files being uploaded to Sentry, this behavior is off by default, but can be turned on with a new option `widenClientFileUpload`: ``` const { withSentryConfig } = require("@sentry/nextjs"); const moduleExports = { sentry: { widenClientFileUpload: true, }, }; const sentryWebpackPluginOptions = { // ... }; module.exports = withSentryConfig(moduleExports, sentryWebpackPluginOptions); ``` This change is documented in getsentry/sentry-docs#4827. Fixes #3896
4e8c3f4
to
956e8a4
Compare
This documents the option added in getsentry/sentry-javascript#4705, which allows users to choose to cast a wider net when uploading sourcemaps for client-side code.