Skip to content

Document that JS source maps are not required to be shipped in production #9557

Open
@viddo

Description

@viddo

Core or SDK?

Platform/SDK

Which part? Which one?

Source Maps (JS)

Description

I do want sourcemaps but I do not want to ship them in production. There's no information around this under https://docs.sentry.io/platforms/javascript/sourcemaps/ but for some reason it's only mentioned for the NextJS "platform": https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#use-hidden-source-map:

Depending on your deployment setup, adding sentry/nextjs to your app may cause your source code to be visible in browser devtools when it wasn't before. (This happens because of the default behavior of webpack's source-map built-in devtool.) To prevent this, you can use hidden-source-map rather than source-map, which will prevent your built files from containing a sourceMappingURL comment, thus making sourcemaps invisible to the browser. To use hidden-source-map, add a sentry object to nextConfig above, and set the hideSourceMaps option to true: …

I am not using NextJS, but I do use Webpack. I only found this through Github issues after searching for an answer. I think it would help others too that don't use NextJS if this would be fully documented.

Related open issues I found while searching for an answer around this:

Suggested Solution

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Waiting for: Support

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions