Private Source Maps for Sentry

Is there a way to enabling source maps for Sentry.io, but stop the source maps from being sent to the clients when they load our webpage.

Currently, I have set the “sourceMap” flag to “true” in the “redwood.toml” file, which generates the source maps successfully. The Sentry CLI confirms that it can locate and upload the source maps.

However, when using this flag, the source maps are also uploaded to our server (hosted on render.com). I’m looking for a solution that allows me to include the source maps for Sentry but excludes them from being uploaded to Render.

Any assistance would be greatly appreciated.

2 Likes

This might not be helpful to you.

This is what I do in docker with gitlab:

[...]

RUN yarn global add @redwoodjs/cli prisma @sentry/cli

RUN sentry-cli releases new api@$CI_COMMIT_SHA && \
  sentry-cli releases files api@$CI_COMMIT_SHA upload-sourcemaps api/dist --rewrite --url-prefix "/app/api/dist" && \
  sentry-cli releases finalize api@$CI_COMMIT_SHA

RUN sentry-cli releases new web@$CI_COMMIT_SHA && \
  sentry-cli releases files web@$CI_COMMIT_SHA upload-sourcemaps web/dist && \
  sentry-cli releases finalize web@$CI_COMMIT_SHA

RUN rm -rf /app/web/dist/static/js/*.map

[...]