mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-01 08:57:50 +02:00
polish(theme): better error messages on navbar item rendering failures + ErrorCauseBoundary API (#8735)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
7961c5b8d5
commit
ea2b13ea94
9 changed files with 98 additions and 9 deletions
|
@ -310,8 +310,8 @@ export function useLayoutDocsSidebar(
|
|||
`Can't find any sidebar with id "${sidebarId}" in version${
|
||||
versions.length > 1 ? 's' : ''
|
||||
} ${versions.map((version) => version.name).join(', ')}".
|
||||
Available sidebar ids are:
|
||||
- ${Object.keys(allSidebars).join('\n- ')}`,
|
||||
Available sidebar ids are:
|
||||
- ${Object.keys(allSidebars).join('\n- ')}`,
|
||||
);
|
||||
}
|
||||
return sidebarEntry[1];
|
||||
|
@ -343,9 +343,9 @@ export function useLayoutDoc(
|
|||
return null;
|
||||
}
|
||||
throw new Error(
|
||||
`DocNavbarItem: couldn't find any doc with id "${docId}" in version${
|
||||
`Couldn't find any doc with id "${docId}" in version${
|
||||
versions.length > 1 ? 's' : ''
|
||||
} ${versions.map((version) => version.name).join(', ')}".
|
||||
} "${versions.map((version) => version.name).join(', ')}".
|
||||
Available doc ids are:
|
||||
- ${uniq(allDocs.map((versionDoc) => versionDoc.id)).join('\n- ')}`,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue