Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
fix(docs): avoid lib/source import to fix top-level await issue
Sushmithamalleshe615eb0a5a2d
diff --git a/docs/app/api/search/route.ts b/docs/app/api/search/route.tsindex c58b3b6ee..15f4d51d4 100644--- a/docs/app/api/search/route.ts+++ b/docs/app/api/search/route.ts@@ -1,15 +1,36 @@-import {- source,- toolRouterSource,- examplesSource,- toolkitsSource,-} from '@/lib/source';+// Use direct imports from collections to avoid top-level await in lib/source.ts+import { docs, toolRouter, examples, toolkits } from 'fumadocs-mdx:collections/server';import { createSearchAPI } from 'fumadocs-core/search/server';+import { loader } from 'fumadocs-core/source';+import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';++// Create loaders directly here to avoid the problematic lib/source.ts import+const docsSource = loader({+ baseUrl: '/docs',+ source: docs.toFumadocsSource(),+ plugins: [lucideIconsPlugin()],+});++const toolRouterSource = loader({+ baseUrl: '/tool-router',+ source: toolRouter.toFumadocsSource(),+ plugins: [lucideIconsPlugin()],+});++const examplesSource = loader({+ baseUrl: '/examples',+ source: examples.toFumadocsSource(),+ plugins: [lucideIconsPlugin()],+});++const toolkitsSource = loader({+ baseUrl: '/toolkits',+ source: toolkits.toFumadocsSource(),+ plugins: [lucideIconsPlugin()],+});-// Note: referenceSource excluded temporarily - it includes OpenAPI pages-// that cause issues with top-level await in serverless environmentsconst allPages = [- ...source.getPages(),+ ...docsSource.getPages(),...toolRouterSource.getPages(),...examplesSource.getPages(),...toolkitsSource.getPages(),