Skip to content

experimental.instrumentationHook is no longer needed, because instrumentation.js is available by default. You can remove it from next.config.ts. #17965

Closed

Description

@coderrshyam

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

10.20.0

Framework Version

React@19.2.0 and Next@16.0.0-beta.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

Just setup simple next.js app configured with sentry. both should be of latest version

Steps to Reproduce

Either run next dev or next build

Expected Result

There should be no warnings

Actual Result

⚠ experimental.instrumentationHook is no longer needed, because instrumentation.js is available by default. You can remove it from next.config.ts.
⚠ Invalid next.config.ts options detected:
⚠ Unrecognized key(s) in object: 'instrumentationHook' at "experimental"
⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config

   ▲ Next.js 16.0.0-canary.10 (Turbopack)
   - Environments: .env.local
   - Experiments (use with caution):
     ✓ browserDebugInfoInTerminal
     · clientTraceMetadata
     ? instrumentationHook (invalid experimental key)
     · optimizePackageImports
     ✓ turbopackFileSystemCacheForDev

Additional Context

Next config code:

import { withSentryConfig } from "@sentry/nextjs";
import { createMDX } from "fumadocs-mdx/next";
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  reactCompiler: true,
  reactStrictMode: true,
  typedRoutes: true,
  transpilePackages: [
    "@react-email/components",
    "@react-three/drei",
    "@react-three/fiber",
    "three",
    "sonner",
  ],

  experimental: {
    clientSegmentCache: true,
    browserDebugInfoInTerminal: true,
    turbopackFileSystemCacheForDev: true,
    optimizePackageImports: [
      "@react-email/components",
      "@react-three/drei",
      "@react-three/fiber",
      "three",
      "three-globe",
      "motion",
    ],
  },
 
};

const withMDX = createMDX();

const sentryConfig = {
  org: process.env.SENTRY_ORG,
  project: process.env.SENTRY_PROJECT,
  disableLogger: true,
  silent: !process.env.CI,
  tunnelRoute: "/monitoring",
  automaticVercelMonitors: true,
  widenClientFileUpload: true,
};

export default withSentryConfig(withMDX(nextConfig), sentryConfig);

Activity

  1. linear commented on Oct 17, 2025

    @linear
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Oct 17, 2025
  3. andreiborza commented on Oct 20, 2025

    @andreiborza
    Member

    Hi @coderrshyam, thanks for filing this. We'll take a look.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 20, 2025
  5. self-assigned this
    on Oct 20, 2025
  6. coderrshyam commented on Oct 20, 2025

    @coderrshyam
    Author

    @andreiborza you can refer it from

    // From Next.js version (15.0.0-canary.124) onwards, Next.js does no longer require the `experimental.instrumentationHook` option and will

  7. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Oct 20, 2025
  8. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 20, 2025
  9. github-actions commented on Oct 21, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #17978, which was included in the 10.21.0 release.

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

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions