fix(nextjs): Pull transpileClientSDK option from correct location#5516
Merged
lobsterkatie merged 4 commits intomasterfrom Aug 4, 2022
Merged
Conversation
AbhiPrasad
approved these changes
Aug 3, 2022
| const { sentry: userSentryOptions } = userNextConfigObject; | ||
| delete userNextConfigObject.sentry; | ||
| // Remind TS that there's now no `sentry` property | ||
| userNextConfigObject = userNextConfigObject as NextConfigObject; |
Contributor
There was a problem hiding this comment.
can't we just do ...(userNextConfigObject as NextConfigObject)? I'd rather not change from const -> let
we can also just declare a new var - modifiedUserNextConfigObject?
Member
Author
There was a problem hiding this comment.
I'd rather not change from
const->let
Why?
(FYI: I'm going to merge this regardless, because I'd like to get this bugfix out, but we can always revisit it later.)
990361f to
4481089
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the process of working simultaneously on both #5472 (which adds the
sentry.transpileClientSDKoption tonext.config.js) and #5473 (which moves thesentryoptions object fromnext.config.jsto a new location halfway through the build process, in order to prevent nextjs from throwing warnings), I missed their overlap. As a result, thetranspileClientSDKoption is still currently being retrieved from the old, pre-move location, even though said retrieval happens in the second half of the build, after the move. (Unsurprisingly, it's therefore always undefined, rendering it useless).This fixes that by pulling it from the new, correct location instead. It also adjusts our types so that future mistakes like this will show up as errors, by creating separate pre-move and post-move
userNextConfigtypes and using them as appropriate.Fixes #5452.