You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using "@sentry/nextjs": "8.47.0", "@sentry/cli": "2.39.1", "@sentry/webpack-plugin": "2.22.7", "next": "14.1.4".
We are employing a micro frontend strategy with nextjs and module federation. As per your documentation on micro frontends, only host is using "@sentry/nextjs" w/ instrumentation while the remotes are using "@sentry/webpack-plugin" in the next.config in order to propagate errors to the appropriate micro frontend project.
Our CI pipeline is restrictive and stops us from uploading source maps to sentry in the same job we build the app docker image. This has lead me to separate the jobs like
Job 1 - Build the app with source maps and inject debug id using the sentry-cli sourcemaps inject. Pass source maps to job 2.
Job 2 - Upload source maps to sentry using sentry-cli source maps upload
Initially I was doing this with one of the remotes that uses sentry/webpack-plugin. Sentry was struggling to map the debug id in the uploaded artifact with the stack trace in the error event. I realized that during build, if we disable source maps in the next.config and let the cli tool do all the work, the debug id are correctly mapped.
The problem: disabling source maps in withSentryConfig from @sentry/nextjs does not have the same effect. debug id are still injected which confuses the sentry engine because a single file can contain both the debug id injected during build and the one injected after build by the cli.
Edit - using "unstable_sentryWebpackPluginOptions" in "withSentryConfig" is a viable workaround
Expected Result
There should be no debug id reference in any file
Actual Result
files (like _app) contain debugid in one of the first lines
disabling source maps in withSentryConfig from @sentry/nextjs does not have the same effect
can you show us how you did this specifically? Usually you should be good with using withSentryConfig without separately installing the @sentry/webpack-plugin.
Also, I'm gonna transfer this issue to our JS SDK repo as this seems like an SDK-related problem as of now.
Hey, one more update: We identified the problem in withSentryConfig and we'll fix it in v9 of the SDK.
Generally, injecting debugIds rarely is a problem, even if you don't upload source maps. You're the first one reporting this and arguably your build setup is fairly special compared to a default NextJS build. Which is why this wasn't surfaced before.
Activity
getsantry commentedon Dec 31, 2024
Assigning to @getsentry/support for routing ⏲️
Lms24 commentedon Jan 21, 2025
Hi @digitalhank
can you show us how you did this specifically? Usually you should be good with using
withSentryConfigwithout separately installing the@sentry/webpack-plugin.Also, I'm gonna transfer this issue to our JS SDK repo as this seems like an SDK-related problem as of now.
Lms24 commentedon Jan 21, 2025
Hey, one more update: We identified the problem in
withSentryConfigand we'll fix it in v9 of the SDK.Generally, injecting debugIds rarely is a problem, even if you don't upload source maps. You're the first one reporting this and arguably your build setup is fairly special compared to a default NextJS build. Which is why this wasn't surfaced before.
Thanks for reporting this!
digitalhank commentedon Jan 21, 2025
I’ve been on vacation. Thanks for fixing the bug.