Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempted import error: 'PGVectorStore' is not exported from 'llamaindex' (imported as 'PGVectorStore'). #1405

Open
2 of 14 tasks
Djmcflush opened this issue Oct 28, 2024 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@Djmcflush
Copy link

Djmcflush commented Oct 28, 2024

Describe the bug
When attempting to import PGVectorStore from the llamaindex package in a Next.js project, an error occurs indicating that PGVectorStore is not exported from llamaindex. I have tried various Node.js versions (v18 and v20) using nvm, and this issue persists across the last 8 releases of llamaindex. The bug blocks the ability to use PGVectorStore despite it being referenced in other examples and documentation.

To Reproduce
Code to reproduce the behavior:

import { PGVectorStore } from 'llamaindex';

// Expected behavior: no import error and successful instantiation of PGVectorStore
// Actual behavior: "Attempted import error: 'PGVectorStore' is not exported from 'llamaindex'"

Expected behavior
I expected PGVectorStore to be exported from llamaindex, allowing it to be imported and used as part of my Next.js project, as referenced in example code found in the documentation.

Screenshots
Not applicable for this issue.

Desktop (please complete the following information):

  • OS: macOS Ventura 13.4.1
  • 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: Node v18.20.4 and v20 (via nvm), Next.js v13.4.5

Additional context
I have tested this on both Node.js v18 and v20 (using nvm) across multiple releases of llamaindex (the last 8 versions). The error persists regardless of the version, preventing usage of PGVectorStore. I have also explored submodule imports, but none of them work. Other vector stores like PostgresDocumentStore work fine, but I specifically need the functionality provided by PGVectorStore.

@Djmcflush Djmcflush added the bug Something isn't working label Oct 28, 2024
@himself65
Copy link
Member

This is expected behavior, please import from llamaindex/vector-store/PGVector ….

@himself65 himself65 added documentation Improvements or additions to documentation good first issue Good for newcomers and removed bug Something isn't working labels Oct 28, 2024
@himself65
Copy link
Member

himself65 commented Oct 28, 2024

I cannot expose it to top level at this time, but will work to fix this by decouple modules in this week

@marcusschiesser
Copy link
Collaborator

@Djmcflush as @himself65 mentions you better should use import { PGVectorStore } from "llamaindex/vector-store" as we don't export vector stores to root for edge run-times.

We're moving now the vector store implementations to each package to avoid confusion, see #1587

closing this for now

@marcusschiesser
Copy link
Collaborator

sorry, we'll keep it open to update the documentation

@marcusschiesser
Copy link
Collaborator

@himself65 I think we should then also remove

export * from "./vector-store.js";
to avoid further confusion between edge and nodejs runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants