Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/nextra-theme/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,12 @@ export default function NextraLayout({ children, pageOpts, pageProps }: NextraTh
defaultLocale,
route: fsPath,
})
for (const item of result.flatDocsDirectories) {
if (!item.route) {
throw new Error(`Route "${item.name}" is not exist. Remove this field from _meta.js file`)
if (typeof window === 'undefined') {
// Execute this check for sidebar links only on server, will be stripped from client build
for (const item of result.flatDocsDirectories) {
if (!item.route) {
throw new Error(`Route "${item.name}" is not exist. Remove this field from _meta.js file`)
}
}
}
return result
Expand Down