Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Not all errors being recorded #9727

Locked
hnykda started this conversation in General
Dec 4, 2023 · 2 comments · 2 replies
Discussion options

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.

You must be logged in to vote

Replies: 2 comments 2 replies

Comment options

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

You must be logged in to vote
1 reply
Comment options

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.

Comment options

Profilling doesn't work at all in next.js,

You must be logged in to vote
1 reply
Comment options

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /