Skip to content

Cannot find module '.../node_modules/llamaindex/dist/cjs/storage/vectorStore/PGVectorStore.js' #310

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

Closed
akma-iman opened this issue Sep 23, 2024 · 7 comments · Fixed by #312 or #322
Assignees

Comments

@akma-iman
Copy link

akma-iman commented Sep 23, 2024

After performing 'npm run generate', I got an error where the project unable to find module for PGVectorStore. The error highlight at this line : import { PGVectorStore } from "llamaindex/storage/vectorStore/PGVectorStore"; in generate.ts file. I hoping this issue can be solved.

I am using latest create-llama version 0.2.8 and PostgresSQL as vector database. I am attach snapshot of my setup here.

Update : I manage to solve this issue by removing this line, import { PGVectorStore } from "llamaindex/storage/vectorStore/PGVectorStore"; in generate.ts file and call the 'PGVectorStore' class directly from llamaindex library. Even though it is solved now, I getting different error which is this : [ERR_MODULE_NOT_FOUND]: Cannot find package 'pg' imported from '.../node_modules/llamaindex/dist/cjs/vector-store/PGVectorStore.js'

Screenshot 2024-09-23 at 2 57 50 PM

@marcusschiesser
Copy link
Collaborator

@akma-iman nice catch with the import! Can you try adding 'pg' to the generated package.json file?

@akma-iman
Copy link
Author

Hi @marcusschiesser! Yes I have adding 'pg' and 'pgvector' to package.json file. The issue is gone now but I faced other issue which is this : error: expected 1536 dimensions, not 1024. I simply change EMBEDDING_DIM in env file from 1024 to 1536. And now I successfully created embeddings.

But once I run localhost and try to type text in the chat box, I got this error : TypeError: llamaindex__WEBPACK_IMPORTED_MODULE_0_.PGVectorStore is not a constructor. I am not sure how to fix this.
Screenshot 2024-09-24 at 10 46 42 AM

@klei30
Copy link

klei30 commented Sep 24, 2024

hi ,
i get the same error with pinecone , secially when i select duckduck web search

#314

@marcusschiesser
Copy link
Collaborator

Sorry for the trouble. The imports and the package.jsons are now updated in create-llama 0.2.9. Please try again.

@akma-iman
Copy link
Author

Hi @marcusschiesser and @thucpn. Thank you for the update. I have try create-llama 0.2.9 from scratch and I am still stuck with this same error : TypeError: llamaindex__WEBPACK_IMPORTED_MODULE_0.PGVectorStore is not a constructor. This error appear after I try to submit my text in the chat box. May I know if this error is fixable?

@thucpn thucpn linked a pull request Sep 25, 2024 that will close this issue
@marcusschiesser
Copy link
Collaborator

fixed in release 0.2.11

@akma-iman
Copy link
Author

Thank you very much! There are no error now and It is working as expected. I really appreciate you guys hard work. Oh by the way, I am not sure why the model does not read my vector store and just provide unrelated response. I think I facing the same issue like here #326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants