@sentry/nextjs: option for `hidden-source-map` instead of `source-map`
See original GitHub issueFirstly, thanks for all your hard work, Sentry is one of the best development tools out there, hands down. 👍
I have a small request for the new @sentry/nextjs plugin. Based on this line here: https://github.com/getsentry/sentry-javascript/blob/60e1982f71b2c7fb664a5adb38d0d730810101ec/packages/nextjs/src/utils/config.ts#L151
It seems the plugin only allows using source-map for devtools. Would it be possible to add an option to use hidden-source-map instead? The current configuration leaves the reference to the source map file, causing Chrome DevTools to report a bunch of
DevTools failed to load SourceMap: Could not load content for https://...: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
since I do not upload the source maps to the server. 🙁
Thanks for the consideration.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Troubleshooting Source Maps for Next.js
If you find that Sentry is not mapping filename, line, or column mappings correctly, you should verify that your source maps are functioning...
Read more >Advanced Features: Source Maps | Next.js
Enables browser source map generation during the production build.
Read more >[nextjs] Original source code visible in browser dev tools #4489
For nextjs config using withSentryConfig, we can't set the devtool value to hidden-source-map as it's overriden by the sentry config wrapper.
Read more >Next.js source maps with typescript on Sentry - Stack Overflow
Is there anyway to get the source maps to work with sentry (without the Enable JavaScript source fetching and without leaving the source...
Read more >Source Maps for JavaScript - Sentry Documentation
Sentry supports un-minifying JavaScript via source maps, which lets you view source code context obtained from stack traces in their original untransformed ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I created a webpack plugin which remove all sourcemaps after sentry’s upload and implement @hellojser solution to remove the sourcemap references to avoid 404 errors by browser calling the unexisting map files
https://github.com/AlexBeauchemin/webpack-delete-sourcemaps-plugin
withSentryConfigwhich is used to generate the config is nothing else than a function that processes input config, and outputs updated one. There’s nothing that’d stop you from changing any of the values once it’s processed.Based on this docs: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#extend-default-webpack-usage-for-source-maps
Given this config (shortened for readabilty):
You can write:
While definitely not perfect, it should let you get unblocked.