Skip to content

Conversation

@logaretm
Copy link
Collaborator

This document outlines the new option introduced in getsentry/sentry-javascript#18798, which was released in 10.34.0.

This option replaces the disableManifestinjection option, providing users with the flexibility to either completely disable this behavior or selectively exclude specific routes from being included in the route manifest.

A common use case for this option is when some routes are private or contain unreleased features. Having these routes present in the route manifest posed challenges for certain users. To address this, an exclude option allows users to avoid the all-or-nothing compromise, ensuring that data quality is maintained and preventing the leakage of route information.

@vercel
Copy link

vercel bot commented Jan 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sentry-docs Ready Ready Preview, Comment Jan 20, 2026 1:58pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
develop-docs Ignored Ignored Jan 20, 2026 1:58pm

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR documents the new routeManifestInjection configuration option for Next.js, which replaces the deprecated disableManifestInjection option released in version 10.34.0. The new option provides more flexibility by allowing users to either completely disable route manifest injection or selectively exclude specific routes.

Changes:

  • Replaced documentation for disableManifestInjection with routeManifestInjection
  • Added documentation for the new object-based configuration with exclude option
  • Included code examples showing how to exclude routes using arrays, regex patterns, or functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 245 to 246
// or a function that return `true` to exclude the route
exclude: (route) => route.includes("/excluded"),
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code example shows two different approaches for the exclude property but uses the same property name twice. This is misleading as the second declaration would overwrite the first in JavaScript. Consider separating these into two distinct examples or using a comment to clarify these are alternatives, not meant to be used together.

Suggested change
// or a function that return `true` to exclude the route
exclude: (route) => route.includes("/excluded"),
// Alternatively, use a function that returns `true` to exclude the route:
// exclude: (route) => route.includes("/excluded"),

Copilot uses AI. Check for mistakes.
logaretm and others added 2 commits January 19, 2026 15:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@inventarSarah inventarSarah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I left a few suggestions 👍

},
```

Excluding specific routes can be useful if you have routes with unreleased features or private routes that you don't want to be included in the route manifest.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to also have a list here like above; for example, "Use this if:"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I think I can come up with a couple of list items.

- You prefer raw URLs in transaction names
- You're only using the Pages Router (this feature is only supported in the App Router)

You can also pass in an object to control which routes should be excluded from the route manifest:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could add here that the object supports exclude so that users know what's supported without relying on the example code.
Or, if there's more, we could list them like here: https://sentry-docs-git-awad-nextjs-route-manifest-injection-doc.sentry.dev/platforms/javascript/guides/nextjs/configuration/options/#transportOptions

Copy link
Collaborator Author

@logaretm logaretm Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now there is only one option, it's an object for some future proofing, but yea "an object" doesn't really tell the user what to expect here.

- You want to minimize client bundle size
- You're experiencing build issues related to route scanning
- You prefer raw URLs in transaction names
- You're only using the Pages Router (this feature is only supported in the App Router)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"this feature is only supported in the App Router" -> should we mention this earlier?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was part of the old description we had but yea I think it should be right under the section title, will update it. Thanks!

logaretm and others added 4 commits January 20, 2026 14:33
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
@logaretm logaretm merged commit 74f9c36 into master Jan 20, 2026
14 checks passed
@logaretm logaretm deleted the awad/nextjs-route-manifest-injection-doc branch January 20, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants