Skip to content

Commit e22bdda

Browse files
heiskrCopilot
andauthored
Make create-tree resilient to missing early-access children (#59968)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8a02308 commit e22bdda

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/frame/lib/create-tree.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,18 @@ export default async function createTree(
4040
}
4141
// Throw an error if we can't find a content file associated with the children: entry.
4242
// But don't throw an error if the user is running the site locally and hasn't cloned the Early Access repo.
43-
if (originalPath === 'content/early-access') {
43+
// Also don't throw for missing children *within* early-access content — a broken
44+
// early-access article should not block every docs-internal PR from merging.
45+
const msg = `Cannot find a content file at ${originalPath}. Check the 'children' frontmatter in the parent index.md.`
46+
47+
if (
48+
originalPath === 'content/early-access' ||
49+
originalPath.startsWith('content/early-access/')
50+
) {
51+
console.warn(`Warning: ${msg}`)
4452
return
4553
}
46-
throw new Error(
47-
`Cannot find a content file at ${originalPath}. Fix the children frontmatter entry "/${path.basename(
48-
originalPath,
49-
)}" in ${path.dirname(originalPath)}/index.md.\n`,
50-
)
54+
throw new Error(msg)
5155
}
5256
}
5357

0 commit comments

Comments
 (0)