Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(docs): Add fallback for reference source loading failure

sohamganatra0d84fd09c3cf
diff --git a/docs/app/llms.mdx/[[...slug]]/route.ts b/docs/app/llms.mdx/[[...slug]]/route.ts
index 898d1c3ca..79f58b46c 100644
--- a/docs/app/llms.mdx/[[...slug]]/route.ts
+++ b/docs/app/llms.mdx/[[...slug]]/route.ts
@@ -434,7 +434,14 @@ export async function GET(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let pageSource: any;
if (prefix === 'reference') {
- pageSource = await getReferenceSource();
+ try {
+ pageSource = await getReferenceSource();
+ } catch (e) {
+ console.error('Error loading reference source:', e);
+ // Fall back to MDX-only reference source if OpenAPI loading fails
+ const { referenceSource } = await import('@/lib/source');
+ pageSource = referenceSource;
+ }
} else {
const match = sources.find((s) => s.prefix === prefix);
if (!match) notFound();