Skip to main content
This guide covers common issues you might encounter when using LlamaIndex.TS and how to resolve them.

Installation Issues

Problem:
Solutions:
  1. Verify installation:
  1. Reinstall dependencies:
  1. Check your Node.js version:
  1. For TypeScript projects, ensure moduleResolution is set correctly:
Problem:
Solutions:
  1. For npm v7+, peer dependencies are installed automatically. You can ignore warnings if your app works.
  2. Install missing peer dependencies manually:
  1. Use --legacy-peer-deps if necessary:
Problem:
Solutions:
  1. Use the recommended pnpm version:
  1. Configure pnpm to handle peer dependencies:
  1. Install with:

Runtime Errors

Problem:
Solutions:401 Unauthorized:
429 Rate Limit:
500 Server Error:
  • Retry the request
  • Check OpenAI status page
  • Implement exponential backoff
Problem:
Solution:Set the embedModel before using it:
Problem:
Solutions:
  1. Increase Node.js memory limit:
  1. Process documents in batches:
  1. Use streaming for large files:
Problem:
Solution:Use the edge-compatible entry point:

Configuration Problems

Problem:
Solutions:
  1. Install and configure dotenv:
  1. For Next.js, use .env.local:
  1. Verify the environment variable is set:
Problem:
Solutions:
  1. Verify credentials:
  1. Check network connectivity:
  1. Increase timeout:
Problem:
Solution:Configure the node parser:

Build and Bundling Issues

Problem:
Solution:Configure Next.js to handle LlamaIndex properly:
Problem:
Solution:Configure Vite:
Problem:
Solutions:
  1. Ensure TypeScript configuration:
  1. Reinstall with types:

Performance Issues

Problem: Embedding generation takes too long.Solutions:
  1. Use batch embedding:
  1. Use a faster model:
  1. Cache embeddings:
Problem: OpenAI API costs are too high.Solutions:
  1. Use smaller models:
  1. Reduce chunk size to minimize embeddings:
  1. Use local models:

Getting More Help

If your issue isn’t covered here:

Discord Community

Get real-time help from the community

GitHub Issues

Report bugs or request features

GitHub Discussions

Ask questions and share solutions

FAQ

Frequently asked questions

Debug Mode

Enable debug logging to troubleshoot issues:
This will show detailed logs about:
  • API calls
  • Document processing
  • Embedding generation
  • Query execution