Skip to content

Unable to run in Deno Deploy and Supabase Edge Functions #1572

Open
@savy-91

Description

@savy-91

Describe the bug
I am trying to run a simple RAG endpoint in Deno Deploy/Supabase Edge Functions and this import makes the bundled function too heavy:
Deploying Function: analyze (script size: 167.8MB)

I tried to import each part individually:

import {
    OpenAI,
    OpenAIAgent,
} from "llamaindex/llm/openai";

import {
    QueryEngineTool,
} from "llamaindex/tools/QueryEngineTool";

import {
    PDFReader,
} from "llamaindex/readers/index";

import {
    FunctionTool,
} from "llamaindex/tools/index";

import {
    VectorStoreIndex,
} from "llamaindex/indices/vectorStore/index";

import {
    Settings,
} from "llamaindex/Settings";

with no significant change.

To Reproduce

import {
    VectorStoreIndex,
    PDFReader,
    Settings,
    OpenAI,
    FunctionTool,
    OpenAIAgent,
    QueryEngineTool,
    Document,
    Metadata
} from "npm:llamaindex@^0.8.30";

Expected behavior
The documentation does not mention any specific procedure to run this in an edge environment like this so I would expect this to run.

Desktop (please complete the following information):

  • OS: [e.g. macOS, Linux]
  • JS Runtime / Framework / Bundler (select all applicable)
  • Node.js
  • Deno
  • Bun
  • Next.js
  • ESBuild
  • Rollup
  • Webpack
  • Turbopack
  • Vite
  • Waku
  • Edge Runtime
  • AWS Lambda
  • Cloudflare Worker
  • Others (please elaborate on this)
  • Version [e.g. 0.8.30]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions