getsentry / getsentry/sentry-javascript

[Next.js] Support setting different options for different runtimes (browser/server/edge)

Open
#13,837 6 comments 1 reaction 0 assignees View on GitHub
Improvement Next.js
Dominant language
TypeScript
Stars
8.7k
Forks
1.8k
Avg merge
1d 17h
Merged PRs (30d)
515

Description

Originally posted by @ricardomatias [in discussions](https://github.com/getsentry/sentry-javascript/discussions/13833):

> I've removed the sentry.edge.config.ts and sentry.server.config.ts and I still get sourcemaps for both of them. I only want client sourcemaps.

I don't think this is possible right now without some very ugly hacks. We should provide some way of setting different options for the different runtimes.

Idea No.1 and probably my favorite: Allow for the `sentryBuildOptions` argument in `withSentryConfig` to be a function/callback that receives the runtime as an argument. (probably should pass it within an object so that we can extend it in the future)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.