langchain-ai / langchainjs

🦜🔗 Build context-aware reasoning applications 🦜🔗
https://js.langchain.com/docs/
MIT License
11.88k stars 1.99k forks source link

SupabaseVectorStore not working on cloudflare #2020

Closed yhmjSky closed 11 months ago

yhmjSky commented 12 months ago

I'm working on a Svelte-related project,I need to use ConversationalRetrievalQAChain and use it on the server. It can be used normally in local development, but when I deploy it to cloudflare, sending the request returns "Internal Error". When I use other chains without vectorStore, it works fine.

Is it because SupabaseVectorStore needs to use memory?

Env

 Binaries:
    Node: 18.15.0
    Npm: 9.5.0
 npmPackages:
    "@sveltejs/adapter-cloudflare": "^2.3.0",
    "@sveltejs/kit": "^1.5.1",
    "supabase": "^1.61.5",
        "svelte": "^3.54.0",
    "langchain": "^0.0.89",
    "typescript": "^5.0.0",
    "vite": "^4.3.0",
jacoblee93 commented 12 months ago

I believe you need @supabase/supabase-js installed, supabase is the CLI. Can you try that?

https://js.langchain.com/docs/modules/data_connection/vectorstores/integrations/supabase#install-the-library-with

yhmjSky commented 12 months ago

I believe you need @supabase/supabase-js installed, supabase is the CLI. Can you try that?

https://js.langchain.com/docs/modules/data_connection/vectorstores/integrations/supabase#install-the-library-with

Thank you for your reply. I tried what you said, but can't seem to solve the problem. Also, not only SupabaseVectorStore, but also MemoryVectorStore doesn't work.

yhmjSky commented 12 months ago

I think it may be that cloudflare does not support it, because it is able to work normally in vercel.

KamaniBhavin commented 12 months ago

As far as I know, Supabase is compatible with Cloudflare. Would you mind sharing your repository? so that I can review it for any potential issues?

yhmjSky commented 11 months ago

I am sorry, the cause of the error is mainly because of the way environment variables are read