Skip to content

Commit 188d1d5

Browse files
authored
Explicitly include doctree for routes at runtime (#15797)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR This PR fixes an issue where `doctree.json` wasn't accessible to a couple of routes due to Vercel serverless filtering created in #15452. It's now explicitly included. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent 143ce1f commit 188d1d5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

next.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,21 @@ const outputFileTracingExcludes = process.env.NEXT_PUBLIC_DEVELOPER_DOCS
8686
],
8787
};
8888

89+
// Explicitly include the pre-computed doc tree files for routes that need them at runtime.
90+
// Both platform-redirect and [[...path]] need the doctree at runtime:
91+
// - platform-redirect: dynamic route with searchParams
92+
// - [[...path]]: calls getDocsRootNode() during prerendering (even though force-static)
93+
// Other routes read frontmatter from source files instead of using doctree (sitemap, api/source-map)
94+
const outputFileTracingIncludes = process.env.NEXT_PUBLIC_DEVELOPER_DOCS
95+
? {
96+
'/platform-redirect': ['public/doctree-dev.json'],
97+
'\\[\\[\\.\\.\\.path\\]\\]': ['public/doctree-dev.json'],
98+
}
99+
: {
100+
'/platform-redirect': ['public/doctree.json'],
101+
'\\[\\[\\.\\.\\.path\\]\\]': ['public/doctree.json'],
102+
};
103+
89104
if (process.env.NODE_ENV !== 'development' && !process.env.NEXT_PUBLIC_SENTRY_DSN) {
90105
throw new Error(
91106
'Missing required environment variable: NEXT_PUBLIC_SENTRY_DSN must be set in production'
@@ -113,6 +128,7 @@ const nextConfig = {
113128
'mermaid',
114129
],
115130
outputFileTracingExcludes,
131+
outputFileTracingIncludes,
116132
images: {
117133
contentDispositionType: 'inline', // "open image in new tab" instead of downloading
118134
remotePatterns: REMOTE_IMAGE_PATTERNS,

0 commit comments

Comments
 (0)