sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Strange sourcemaps names in upload + no traces on client side

Open ReDev1L opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [x] I have reviewed the documentation https://docs.sentry.io/
  • [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

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

ReDev1L avatar Oct 10 '24 18:10 ReDev1L

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?

Lms24 avatar Oct 11 '24 08:10 Lms24

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar Nov 02 '24 07:11 getsantry[bot]