Uh oh!
There was an error while loading. Please reload this page.
fix(nextjs): correct withSentryConfig return type - #6677
Conversation
lforst
commented
Jan 7, 2023
Hi, thanks for opening this PR. The return type was intentionally kept broad because we might want to change this again in the future without introducing a breaking change. |
seanparmelee
commented
Jan 7, 2023
Thanks for the consideration. FWIW, #6291 was a bit of a breaking change for us because we were expecting withSentryConfig to return an object since we're passing in an object and TS didn't catch it because it thinks an object can still be returned. |
lforst
commented
Jan 7, 2023
TS should complain if you don't handle the case where an object is returned. Technically this was not a breaking change. |
It might be helpful if I provide a bit more background on how we encountered this. // next.config.jsconstwithTM=require('next-transpile-modules')([...]);const{ withSentryConfig }=require('@sentry/nextjs');
...
module.exports=withTM(withSentryConfig({
...
},{...}));We're currently using Fortunately, we realized this particular app longer needs |
In #6291,
withSentryConfigwas updated to always return a function so this PR updates the return value type to no longer includeNextConfigObject.