mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 04:42:40 +02:00
fix(v2): DocNavbarItem error message (#4554)
* Fix DocNavbarItem error message * Clean code * clean code
This commit is contained in:
parent
9fceeb9ec5
commit
902aad55bb
1 changed files with 3 additions and 4 deletions
|
@ -27,11 +27,10 @@ export default function DocNavbarItem({
|
||||||
|
|
||||||
const doc = version.docs.find((versionDoc) => versionDoc.id === docId);
|
const doc = version.docs.find((versionDoc) => versionDoc.id === docId);
|
||||||
if (!doc) {
|
if (!doc) {
|
||||||
|
const docIds = version.docs.map((versionDoc) => versionDoc.id).join('\n- ');
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`DocNavbarItem: couldn't find any doc with id=${docId} in version ${
|
`DocNavbarItem: couldn't find any doc with id=${docId} in version ${version.name}.
|
||||||
version.name
|
Available docIds=\n- ${docIds}`,
|
||||||
}.
|
|
||||||
Available docIds=\n- ${version.docs.join('\n- ')}`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue