CORS error appears when I use query method from API

I have this error when i use API for query vectors. Anyone have a solution?

I try to call this method Pinecone API from a NextJS application.

Its weird because I can listIndexes, describeIndex, createIndex without problem.

Hi @Cedrian. This can happen when running services on localhost. We have an article in our Support Portal that addresses this along with suggested fixes.

Hi @Cory_Pinecone. I’m not using a server between pinecone and my frontend that’s why I need a way to add trusted domains so I can call this endpoint POST https://index_name-project_id.svc.environment.pinecone.io/query This is why at the moment I’m developing an app that still uses localhost. In the article you sent me it mentions that a server other than localhost should be used, but I’m using it for development. Note: I can’t use a server in the middle because it’s not my use case.

I have the same problem running a Next.js app just trying to call Pinecone on the front end (not in api folder)

Hi Cory, thank you or the article, but I don’t see the solution there. Also, I’m having this problem when running on my webserver - not in localhost. Please advise, thanks!

1 Like

I am also running into the same error, except I have deployed my website on heroku and I still run into the same error. Anyone have a solution? I am calling the the query function in a file in my frontend, should I be calling it in my backend?

1 Like

@Cory_Pinecone, Same error here, The suggested link only references using localhost which I am not. I’ve hosted my app on Firebase and am still getting the same error type.

App built in Flutter, calling pinecone and OpenAI Api’s (only pinecone failing)

Same problem on my end. Does anyone found a solution?