Skip to content
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

Strange sourcemaps names in upload + no traces on client side #13947

Open
3 tasks done
ReDev1L opened this issue Oct 10, 2024 · 1 comment
Open
3 tasks done

Strange sourcemaps names in upload + no traces on client side #13947

ReDev1L opened this issue Oct 10, 2024 · 1 comment
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Waiting for: Community

Comments

@ReDev1L
Copy link

ReDev1L commented Oct 10, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

8.33.1

Framework Version

Next.js 15.0.0-canary.179

Link to Sentry event

https://sentry.io/issues/5906193606/?project=4507742455398400

Reproduction Example/SDK Setup

build.log

sentry.client.config.ts

// This file configures the initialization of Sentry on the client.
// The config you add here will be used whenever a users loads a page in their browser.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from "@sentry/nextjs"

Sentry.init({
  // Setting this option to true will print useful information to the console while you're setting up Sentry.
  debug: false,

  dsn: "",
  enabled: process.env.NODE_ENV === "production",
  // You can remove this option if you're not planning to use the Sentry Session Replay feature:
  integrations: [
    Sentry.replayIntegration({
      blockAllMedia: true,
      // Additional Replay configuration goes in here, for example:
      maskAllText: true,
    }),
    Sentry.browserTracingIntegration(),
    Sentry.browserProfilingIntegration(),
    Sentry.httpClientIntegration(),
  ],
  replaysOnErrorSampleRate: 1.0,

  // This sets the sample rate to be 10%. You may want this to be 100% while
  // in development and sample at a lower rate in production
  replaysSessionSampleRate: 0.1,

  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: 0.25,
})

Steps to Reproduce

Ran the npx @sentry/wizard@latest -i nextjs with the recommended configuration for each step
next.config.mjs

import withBundleAnalyzer from "@next/bundle-analyzer"
import {withSentryConfig} from "@sentry/nextjs"
import createJiti from "jiti"
import {fileURLToPath} from "node:url"

const jiti = createJiti(fileURLToPath(import.meta.url))
const withVercelToolbar = (
  await import("@vercel/toolbar/plugins/next")
).default()
jiti("./lib/env")

const nextConfig = {
  reactStrictMode: true,
  experimental: {
    ppr: "incremental",
    // reactCompiler: true,
    staleTimes: {
      dynamic: 30,
    },
    serverActions: {
      bodySizeLimit: "512mb",
    },
  },
  logging: {
    fetches: {
      fullUrl: true,
    },
  },
  pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
  skipTrailingSlashRedirect: true,

}

const bundleAnalyzerConfig = {
  enabled: process.env.ANALYZE === "true",
}

const sentryConfig = {
  automaticVercelMonitors: true,
  disableLogger: true,
  hideSourceMaps: true,
  org: "",
  project: "",
  reactComponentAnnotation: {
    enabled: true,
  },
  silent: !process.env.CI,
  tunnelRoute: "/monitoring",
  widenClientFileUpload: true,
}

const headers = async () => [
  {
    headers: [
      {
        key: "Document-Policy",
        value: "js-profiling",
      },
    ],
    source: "/:path*",
  },
]


const composedConfig = withBundleAnalyzer(bundleAnalyzerConfig)(
  withSentryConfig(withVercelToolbar(nextConfig), {
    ...sentryConfig,
    telemetry: false,
    headers,
  }),
)
export default composedConfig

Expected Result

traces plz!

Actual Result

no traces!
Image

@github-actions github-actions bot added the Package: nextjs Issues related to the Sentry Nextjs SDK label Oct 10, 2024
@Lms24
Copy link
Member

Lms24 commented Oct 11, 2024

Hi @ReDev1L thanks for writing in! I tried reproducing this with a new NextJS canary app on the same version, following your code snippets. The only difference is that I couldn't get jiti to work (neither do I know why it's needed). Unfortunately, I can't reproduce the issue and I'm a bit confused by the issue description.

For us to debug this further, please:

  • provide a minimal repoduction (GH repo, Stackblitz, zip, whatever)
  • elaborate what you mean with "strange source map names". I think they just look like normal JS files?
  • let us know how to trigger the error you showed in the screenshot
  • I couldn't access the link you posted to your Sentry error. Any chance there's a typo in it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Waiting for: Community
Projects
Status: Waiting for: Community
Development

No branches or pull requests

2 participants