mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(website): render syntax and mdx on the server (#9086)
This commit is contained in:
@@ -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`, {
|
||||
|
||||
Reference in New Issue
Block a user