Skip to content

Sentry doing nothing on a NextJS application run within NX #6314

@jporsay

Description

@jporsay

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.21.1

Framework Version

No response

Link to Sentry event

No response

Steps to Reproduce

Given that we're using NX for our service, we cannot use the wizard to automatically configure our application, so we followed the manual steps and created all of the files within our application folder, apps/app (not the root of the repository).

Which means that is / is the root of the repository, we now have the following files in the following paths:

  • apps/app/sentry.client.config.js
  • apps/app/sentry.server.config.js
  • apps/app/.sentryclirc
  • apps/app/sentry.properties

We also:

  • Modified the next.config.js to add the withSentryConfig with extra values for Sentry (or the webpack plugin).
  • Added the custom _error page.

We've added a console.log to both sentry.client.config.js and sentry.server.config.js to see if they're being called (trying to diagnose the symptom).

We've executed nx serve app from the root of the project.

Expected Result

  • We can see the console.log appear in the console of the client/server (confirming that Sentry.init has been executed).
  • When performing an action that throws an error we expect it to see it reported in Sentry.

Actual Result

  • No log appears
  • No message from Sentry appears
  • No error is reported

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions