-
-
Notifications
You must be signed in to change notification settings - Fork 103
Enable Production Source Maps for Improved Frontend Error Traceability #1567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughThe Next.js configuration was updated to enable production browser source maps by setting Changes
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
frontend/next.config.ts (1)
7-7
: Improve source map security and formatting.
- Adjust indentation to align with the existing 2-space style.
- Prevent serving
.map
files to end users while still uploading them to Sentry by using the Sentry Webpack Plugin optionstripSourceMappingUrl
.--- a/frontend/next.config.ts @@ const nextConfig: NextConfig = { - productionBrowserSourceMaps: true, // Enable source maps for production + productionBrowserSourceMaps: true, // Enable source maps for production--- a/frontend/next.config.ts @@ export default withSentryConfig(nextConfig, { - disableLogger: false, + disableLogger: false, + stripSourceMappingUrl: true // removes sourceMappingURL comments from shipped files })
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rishyym0927 are you sure this is enough to enable Sentry source map uploads?
According to the documentation and the research I have done, it should work. But since I cant build and deploy this project to real world, I cant be very sure of it! And thats the only way to verify |
Any references please? |
This is the official response I got through AI from Sentry Official Website @arkid15r -> The Key points from the knowledge sources:
Example usage in const nextConfig = {
productionBrowserSourceMaps: true,
// ...other config
};
module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions); Summary: |
It looks like the main part ( |
should I work on this and update you on the progress? |
|
The issue is |
https://github.com/OWASP/Nest/actions/runs/15719115963/job/44296500205#step:8:430 |
This PR enables production source maps in the Next.js frontend configuration by setting productionBrowserSourceMaps: true. This change allows error reporting tools like Sentry to display readable, unminified stack traces referencing the original source files, making frontend error reports much easier to debug.
Fixes #1561