feat(website): render syntax and mdx on the server (#9086)

This commit is contained in:
Suneet Tipirneni
2023-03-23 17:17:41 -04:00
committed by GitHub
parent bc641fa936
commit ee5169e0aa
91 changed files with 820 additions and 1688 deletions

View File

@@ -15,7 +15,13 @@ export async function fetchModelJSON(packageName: string, version: string): Prom
join(process.cwd(), '..', '..', 'packages', packageName, 'docs', 'docs.api.json'),
'utf8',
);
return JSON.parse(res);
try {
return JSON.parse(res);
} catch {
console.log(res);
return {};
}
}
const response = await fetch(`https://docs.discordjs.dev/docs/${packageName}/${version}.api.json`, {