You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix AI SDK package resolution in Vercel deployment
Resolves the "Cannot find package '@ai-sdk/gateway'" error by:
1. Added @ai-sdk/* packages as optional peer dependencies in service-ai
- These are only needed when specific env vars are set
- Marked as optional to avoid installation errors when not needed
2. Added @ai-sdk/* packages as dependencies in studio app
- Required for LLM auto-detection feature in production
3. Updated esbuild external list to exclude @ai-sdk packages
- Prevents bundling so dynamic imports work correctly
- Allows runtime resolution from node_modules
4. Updated build-vercel.sh to copy @ai-sdk packages
- Copies packages from monorepo to local node_modules
- Required for Vercel's pnpm workspace resolution
5. Updated vercel.json includeFiles to bundle @ai-sdk packages
- Ensures packages are included in serverless function
This allows the AI service to gracefully detect and load LLM providers
based on environment variables without build-time bundling issues.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
0 commit comments