question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sentry doing nothing on a NextJS application run within NX

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:6
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jporsaycommented, Nov 28, 2022

Here’s the reproduction repository: https://github.com/jporsay/sentry-nx-issue

0reactions
github-actions[bot]commented, Dec 22, 2022

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 label it Status: Backlog or Status: In Progress, I will leave it alone … forever!


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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting for Next.js - Sentry Documentation
If your application started to misbehave because of performing additional OPTIONS requests, it is most likely an issue with unwanted sentry-trace request ...
Read more >
@nrwl/next | Nx
Scaffolding for creating, building, serving, linting, and testing Next.js applications. Integration with building, serving, and exporting a Next.js application.
Read more >
Module not found: Can't resolve 'fs' in Next.js application
The solution was to go to the node. js web page, download the latest version and just install it. And then re-run the...
Read more >
How to Build a Monorepo with Nx, Next.js and TypeScript
js applications and React component libraries. It will also help us in running a development web server with hot module reload. It can...
Read more >
How to Build Scalable Architecture for your Next.js Project
How to Build a Complete Next.js App (2 Part Series) ... didn't specifically say anything about yarn , we do that in package.json...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found