8000 Next js 13 `app` directory: using nested route groups causes the `filename` and `function` to be incorrect · Issue #7888 · getsentry/sentry-javascript · GitHub
[go: up one dir, main page]

Skip to content
Next js 13 app directory: using nested route groups causes the filename and function to be incorrect #7888
@patshologram

Description

@patshologram

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

7.48.0

Framework Version

Next 13.2.4 & 13.3.1-canary.12

Link to Sentry event

No response

SDK Setup

the default ones generated via npx @sentry/wizard -i nextjs

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

import * as Sentry from '@sentry/nextjs';

const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;

Sentry.init({
  dsn: SENTRY_DSN || '<PROVIDE_DSN>',
  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: 1.0,
  // ...
  // Note: if you want to override the automatic release value, do not set a
  // `release` value here - use the environment variable `SENTRY_RELEASE`, so
  // that it will also get attached to your source maps
});

Steps to Reproduce

  1. check out https://github.com/patshologram/patshologram-next-routes-with-sentry
  2. search for PROVIDE_ and set the DSN, project and org name
  3. start with yarn build && yarn start
  4. open the devtools in your browser
  5. call http://localhost:3000/synthetic
  6. check the console output and compare it with the payload sent in the network tab

Expected Result

filename and function should be correctly set

Actual Result

When using Route Groups to provide different layouts to different services (tried to replicate our structure in the example github link above). When nesting these route groups, it seems like sentry does not split up the filename and the function correctly, therefore the source maps are not working.

Screenshot 2023-04-18 at 15 04 52

Metadata

Metadata

Assignees

Labels

Package: nextjsIssues related to the Sentry Nextjs SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0