-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
-
Hi. This sounds like a classic issue with misconfiguration, but I am starting to be desperate.
We have a NextJS 14.0.1 app with Sentry @sentry/nextjs@7.77.0, deployed on vercel. We don't use anything fancy, fairly simple basic config:
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
experimental: {
webpackBuildWorker: true,
},
};
module.exports = nextConfig;
if (process.env.NEXT_PUBLIC_ENABLE_SENTRY === 'true') {
const { withSentryConfig } = require('@sentry/nextjs');
module.exports = withSentryConfig(
module.exports,
{
silent: true,
org: '...',
project: 'alpha',
},
{
widenClientFileUpload: true,
transpileClientSDK: true,
tunnelRoute: '/monitoring',
hideSourceMaps: true,
disableLogger: true,
maxValueLength: 16000,
attachStacktrace: true,
normalizeDepth: 5,
},
);
}
server
import * as Sentry from '@sentry/nextjs';
Sentry.init({
dsn: '...',
tracesSampleRate: 1,
debug: false,
});
client
import * as Sentry from '@sentry/nextjs';
Sentry.init({
dsn: '...',
tracesSampleRate: 1,
tracePropagationTargets: [
'localhost',
'...our domain'
],
debug: false,
replaysOnErrorSampleRate: 0.001,
replaysSessionSampleRate: 0.1,
integrations: [new Sentry.Replay(), new Sentry.BrowserTracing()],
});
When I create a test error, like triggering a new Error("test") on FE (e.g. in a react component) or BE (e.g. in a HTTP endpoint) when clicking on a button, it works, gets properly recorded in sentry.
But at the same time we know for sure that there are more errors happening - and they get very rarely recorded in sentry (like maybe only 1/10 errors). I can't find out what the reason for this discrepancy is. Users send us screenshots with clear errors that should end up in sentry, but nothing shows up for us. Any idea what's going on? Is there something obvious I am missing? I do realize this is a somewhat nebulous question, but I will appreciate even indirect proposals for debugging or something.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 2 replies
-
Users send us screenshots with clear errors that should end up in sentry, but nothing shows up for us
Is this maybe because of adblockers? I recognize you setup a tunneling route - but maybe that too is being blocked?
Are you using app or pages router? For the app router we just updated our error boundary docs - perhaps this will help? https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#report-react-component-render-errors
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks for the tip and response, I will check if it could be adblockers, but it would be somewhat surprising given the route. E.g. my adblocker in brave browser is not blocking /monitoring and I would consider that one being quite strict.
We are using app router, so I will try to add that error boundary thing.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Profilling doesn't work at all in next.js,
Beta Was this translation helpful? Give feedback.
All reactions
-
@javiermarcon please open a GH issue: https://github.com/getsentry/sentry-javascript/issues and provide some details about your app and SDK setup. We will take a look further!
Beta Was this translation helpful? Give feedback.