@devries-cameron20 / composio Mirror · read-only / commits / e615eb0a5
Fork 0

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

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 14:30 UTC

fix(docs): avoid lib/source import to fix top-level await issue

Sushmithamallesh committed Jan 16, 2026 at 13:31 UTC e615eb0a5a2d7135c8f40e31a634ae3c139bb64b
1 file changed +30 -9
docs/app/api/search/route.ts
+30 -9
@@ -1,15 +1,36 @@
1 -import {
2 - source,
3 - toolRouterSource,
4 - examplesSource,
5 - toolkitsSource,
6 -} from '@/lib/source';
1 +// Use direct imports from collections to avoid top-level await in lib/source.ts
2 +import { docs, toolRouter, examples, toolkits } from 'fumadocs-mdx:collections/server';
3 import { createSearchAPI } from 'fumadocs-core/search/server';
4 +import { loader } from 'fumadocs-core/source';
5 +import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';
6 +
7 +// Create loaders directly here to avoid the problematic lib/source.ts import
8 +const docsSource = loader({
9 + baseUrl: '/docs',
10 + source: docs.toFumadocsSource(),
11 + plugins: [lucideIconsPlugin()],
12 +});
13 +
14 +const toolRouterSource = loader({
15 + baseUrl: '/tool-router',
16 + source: toolRouter.toFumadocsSource(),
17 + plugins: [lucideIconsPlugin()],
18 +});
19 +
20 +const examplesSource = loader({
21 + baseUrl: '/examples',
22 + source: examples.toFumadocsSource(),
23 + plugins: [lucideIconsPlugin()],
24 +});
25 +
26 +const toolkitsSource = loader({
27 + baseUrl: '/toolkits',
28 + source: toolkits.toFumadocsSource(),
29 + plugins: [lucideIconsPlugin()],
30 +});
31
9 -// Note: referenceSource excluded temporarily - it includes OpenAPI pages
10 -// that cause issues with top-level await in serverless environments
32 const allPages = [
12 - ...source.getPages(),
33 + ...docsSource.getPages(),
34 ...toolRouterSource.getPages(),
35 ...examplesSource.getPages(),
36 ...toolkitsSource.getPages(),