Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

dx(frontend): enable Next.js sourcemaps for Sentry (#11161)

Ubbe938834ac8392
diff --git a/autogpt_platform/frontend/next.config.mjs b/autogpt_platform/frontend/next.config.mjs
index b3b58b575f..5fab1f2ee3 100644
--- a/autogpt_platform/frontend/next.config.mjs
+++ b/autogpt_platform/frontend/next.config.mjs
@@ -2,6 +2,7 @@ import { withSentryConfig } from "@sentry/nextjs";
/** @type {import('next').NextConfig} */
const nextConfig = {
+ productionBrowserSourceMaps: true,
images: {
domains: [
"images.unsplash.com",
@@ -74,6 +75,14 @@ export default isDevelopmentBuild
// since the source is public anyway :)
hideSourceMaps: false,
+ // This helps Sentry with sourcemaps... https://docs.sentry.io/platforms/javascript/guides/nextjs/sourcemaps/
+ sourcemaps: {
+ disable: false, // Source maps are enabled by default
+ assets: ["**/*.js", "**/*.js.map"], // Specify which files to upload
+ ignore: ["**/node_modules/**"], // Files to exclude
+ deleteSourcemapsAfterUpload: true, // Security: delete after upload
+ },
+
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,