Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
9.17.0
Framework Version
Next.js 15.3.0
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
I have the following setup with Next.js 15.3.0 and getting this warning in the next build
. My config:
instrumentation-client.ts
import * as Sentry from '@sentry/nextjs';
import posthog from 'posthog-js';
const IGNORE_ERRORS = [
'Connection closed.',
'Failed to fetch',
'network error',
'Load failed',
];
Sentry.init({
enabled: process.env.NODE_ENV === 'production',
dsn: 'SOMETHING',
ignoreErrors: IGNORE_ERRORS,
tracesSampleRate: 0.25,
debug: false,
release: process.env.NEXT_PUBLIC_SENTRY_RELEASE,
replaysOnErrorSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
profilesSampleRate: 0.25,
integrations: [
Sentry.replayIntegration({
maskAllText: false,
blockAllMedia: false,
maskAllInputs: false,
}),
Sentry.browserProfilingIntegration(),
posthog.sentryIntegration({
organization: 'https://sentry.io/organizations/SOMETHING/projects/',
projectId: SOMETHING,
severityAllowList: ['error', 'info'],
}),
],
});
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
export const onRequestError = Sentry.captureRequestError;
instrumentation.ts
import * as Sentry from '@sentry/nextjs';
export const onRequestError = Sentry.captureRequestError;
export async function register() {
if (
process.env.NEXT_RUNTIME === 'nodejs' &&
process.env.NODE_ENV === 'production'
) {
await import('./sentry.server.config');
}
if (process.env.NEXT_RUNTIME === 'edge') {
await import('./sentry.edge.config');
}
}
Expected Result
Message was not supposed to be there.
I tried moving the export in different places (like in the sentry.*.config
) and nothing.
I tried to use silent: false, debug: true
to get any hints and nothing.
I have another build with Next.js 14 and the warning is not there.
Actual Result
▲ Next.js 15.3.0
- Environments: .env.production.local, .env.local
- Experiments (use with caution):
✓ webpackBuildWorker
· clientTraceMetadata
Creating an optimized production build ...
[@sentry/nextjs] Could not find `onRequestError` hook in instrumentation file. This indicates outdated configuration of the Sentry SDK. Use `Sentry.captureRequestError` to instrument the `onRequestError` hook: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#errors-from-nested-react-server-components
[@sentry/nextjs] Could not find `onRequestError` hook in instrumentation file. This indicates outdated configuration of the Sentry SDK. Use `Sentry.captureRequestError` to instrument the `onRequestError` hook: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#errors-from-nested-react-server-components
[@sentry/nextjs] Could not find `onRequestError` hook in instrumentation file. This indicates outdated configuration of the Sentry SDK. Use `Sentry.captureRequestError` to instrument the `onRequestError` hook: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#errors-from-nested-react-server-components
✓ Compiled successfully in 3.9min
Skipping validation of types
Metadata
Metadata
Assignees
Type
Projects
Status
Waiting for: Product Owner