-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
docs(nextjs): document the route manifest injection option #16076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this 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
disableManifestInjectionwithrouteManifestInjection - Added documentation for the new object-based configuration with
excludeoption - 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.
docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx
Outdated
Show resolved
Hide resolved
| // or a function that return `true` to exclude the route | ||
| exclude: (route) => route.includes("/excluded"), |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
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.
| // 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"), |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx
Outdated
Show resolved
Hide resolved
inventarSarah
left a comment
There was a problem hiding this 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 👍
docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx
Outdated
Show resolved
Hide resolved
docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx
Outdated
Show resolved
Hide resolved
| }, | ||
| ``` | ||
|
|
||
| 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. |
There was a problem hiding this comment.
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:"
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
Co-authored-by: Sarah Mischinger <sarah@codingwriter.com>
This document outlines the new option introduced in getsentry/sentry-javascript#18798, which was released in
10.34.0.This option replaces the
disableManifestinjectionoption, 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
excludeoption allows users to avoid the all-or-nothing compromise, ensuring that data quality is maintained and preventing the leakage of route information.