Skip to content

Commit 20d15ab

Browse files
authored
docs(js): Add missing build option for react component annotation in nextjs (#14556)
1 parent ff34007 commit 20d15ab

File tree

1 file changed

+21
-5
lines changed
  • docs/platforms/javascript/guides/nextjs/configuration/build

1 file changed

+21
-5
lines changed

docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ You can optionally re-throw the error to fail the build process.
8383
withSentryConfig(nextConfig, {
8484
// ... other options
8585
errorHandler: (error) => {
86-
console.warn('Sentry build error occurred:', error);
86+
console.warn("Sentry build error occurred:", error);
8787
// Optionally, you can still fail the build by re-throwing the error
8888
// throw error;
89-
}
89+
},
9090
});
9191
```
9292

@@ -241,9 +241,12 @@ This option can be set to:
241241
Learn more about tunneling in the <PlatformLink to="/troubleshooting/#dealing-with-ad-blockers">troubleshooting section</PlatformLink>.
242242

243243
<Expandable level="warning" title="Using Next.js middleware on Turbopack">
244-
If you're using Turbopack, client-side event recording will fail if your Next.js middleware intercepts the configured tunnel route. To fix this, set the route to a fixed string (like `/error-monitoring`) and add a negative matcher like `(?!error-monitoring)` in your middleware to exclude the tunnel route.
245-
246-
If you're not using Turbopack, Sentry will automatically skip the tunnel route in your middleware.
244+
If you're using Turbopack, client-side event recording will fail if your
245+
Next.js middleware intercepts the configured tunnel route. To fix this, set
246+
the route to a fixed string (like `/error-monitoring`) and add a negative
247+
matcher like `(?!error-monitoring)` in your middleware to exclude the tunnel
248+
route. If you're not using Turbopack, Sentry will automatically skip the
249+
tunnel route in your middleware.
247250
</Expandable>
248251

249252
</SdkOption>
@@ -261,13 +264,26 @@ Disables automatic injection of the route manifest into the client bundle.
261264
The route manifest is a build-time generated mapping of your Next.js App Router routes that enables Sentry to group transactions by parameterized route names (e.g., `/users/:id` instead of `/users/123`, `/users/456`, etc.).
262265

263266
**Disable this option if:**
267+
264268
- You want to minimize client bundle size
265269
- You're experiencing build issues related to route scanning
266270
- You prefer raw URLs in transaction names
267271
- You're only using the Pages Router (this feature is only supported in the App Router)
268272

269273
</SdkOption>
270274

275+
<SdkOption name="reactComponentAnnotation.enabled" type="boolean" defaultValue="false">
276+
277+
Enables React component name tracking. When enabled, it annotates React components with data attributes that allow Sentry to track which components users interacted with in features like Session Replay and breadcrumbs.
278+
279+
</SdkOption>
280+
281+
<SdkOption name="reactComponentAnnotation.ignoredComponents" type="string[] | undefined">
282+
283+
A list of React component names to exclude from component annotation.
284+
285+
</SdkOption>
286+
271287
<SdkOption
272288
name="unstable_sentryWebpackPluginOptions"
273289
type="SentryWebpackPluginOptions"

0 commit comments

Comments
 (0)